[exim-cvs] Fix missing return value from exim_chown_failure

Top Page
Delete this message
Reply to this message
Author: Exim Git Commits Mailing List
Date:  
To: exim-cvs
Subject: [exim-cvs] Fix missing return value from exim_chown_failure
Gitweb: https://git.exim.org/exim.git/commitdiff/ecf14f2aeb1baccb27426d3c2e3b7a0b4f4f2e23
Commit:     ecf14f2aeb1baccb27426d3c2e3b7a0b4f4f2e23
Parent:     6940b3dfaf59844a1fd881720e9342f12922981a
Author:     Heiko Schlittermann (HS12-RIPE) <hs@???>
AuthorDate: Mon Apr 22 22:20:45 2019 +0200
Committer:  Heiko Schlittermann (HS12-RIPE) <hs@???>
CommitDate: Mon Apr 22 22:20:45 2019 +0200


    Fix missing return value from exim_chown_failure
---
 src/src/exim.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


diff --git a/src/src/exim.c b/src/src/exim.c
index 2dbc411..0184d71 100644
--- a/src/src/exim.c
+++ b/src/src/exim.c
@@ -690,6 +690,7 @@ of chown()/fchown().  See src/functions.h for more explanation */
 int
 exim_chown_failure(int fd, const uschar *name, uid_t owner, gid_t group)
 {
+int saved_errno = errno;  /* from the preceeding chown call */
 #if 1
 log_write(0, LOG_MAIN|LOG_PANIC,
   __FILE__ ":%d: chown(%s, %d:%d) failed (%s)."
@@ -701,7 +702,6 @@ log_write(0, LOG_MAIN|LOG_PANIC,
    See Bug 2391
    HS 2019-04-18 */


-int saved_errno = errno; /* from the preceeding chown call */
struct stat buf;

if (0 == (fd < 0 ? stat(name, &buf) : fstat(fd, &buf)))
@@ -711,9 +711,9 @@ if (0 == (fd < 0 ? stat(name, &buf) : fstat(fd, &buf)))
}
else log_write(0, LOG_MAIN|LOG_PANIC, "Stat failed on %s: %s", name, strerror(errno));

+#endif
errno = saved_errno;
return -1;
-#endif
}