]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: process-stat - Use eacces_error_get() for EACCES errno
authorAki Tuomi <aki.tuomi@open-xchange.com>
Tue, 21 Mar 2023 07:13:35 +0000 (09:13 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Tue, 28 Mar 2023 10:21:14 +0000 (10:21 +0000)
This tells better why the open failed.

src/lib/process-stat.c

index 1d23c89964b4cea85952fbbedb992e900df42013..454d9335d2a5862b5657c3df007744aa6992cb8f 100644 (file)
@@ -4,6 +4,7 @@
 #include "buffer.h"
 #include "str.h"
 #include "istream.h"
+#include "eacces-error.h"
 #include "process-stat.h"
 #include "time-util.h"
 #include <limits.h>
@@ -69,8 +70,10 @@ static int open_fd(const char *path, struct event *event)
                errno = EACCES;
        }
        if (fd == -1) {
-               if (errno == ENOENT || errno == EACCES)
+               if (errno == ENOENT)
                        e_debug(event, "open(%s) failed: %m", path);
+               else if (errno == EACCES)
+                       e_debug(event, "%s", eacces_error_get("open", path));
                else
                        e_error(event, "open(%s) failed: %m", path);
        }