diff options
Diffstat (limited to 'contrib/sendmail/libsmdb/smdb.c')
| -rw-r--r-- | contrib/sendmail/libsmdb/smdb.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/contrib/sendmail/libsmdb/smdb.c b/contrib/sendmail/libsmdb/smdb.c index e4bc3413a2506..4598f333153da 100644 --- a/contrib/sendmail/libsmdb/smdb.c +++ b/contrib/sendmail/libsmdb/smdb.c @@ -8,7 +8,7 @@ */ #include <sm/gen.h> -SM_RCSID("@(#)$Id: smdb.c,v 8.53 2001/11/19 19:31:14 gshapiro Exp $") +SM_RCSID("@(#)$Id: smdb.c,v 8.54 2002/04/04 21:32:14 gshapiro Exp $") #include <fcntl.h> #include <stdlib.h> @@ -119,15 +119,14 @@ smdb_lockfile(fd, type) if (!bitset(LOCK_NB, type) || (save_errno != EACCES && save_errno != EAGAIN)) { - int omode = -1; -# ifdef F_GETFL - (void) fcntl(fd, F_GETFL, &omode); - errno = save_errno; -# endif /* F_GETFL */ # if 0 + int omode = fcntl(fd, F_GETFL, NULL); + int euid = (int) geteuid(); + syslog(LOG_ERR, "cannot lockf(%s%s, fd=%d, type=%o, omode=%o, euid=%d)", - filename, ext, fd, type, omode, (int) geteuid()); + filename, ext, fd, type, omode, euid); # endif /* 0 */ + errno = save_errno; return false; } #else /* !HASFLOCK */ @@ -140,15 +139,14 @@ smdb_lockfile(fd, type) if (!bitset(LOCK_NB, type) || save_errno != EWOULDBLOCK) { - int omode = -1; -# ifdef F_GETFL - (void) fcntl(fd, F_GETFL, &omode); - errno = save_errno; -# endif /* F_GETFL */ # if 0 + int omode = fcntl(fd, F_GETFL, NULL); + int euid = (int) geteuid(); + syslog(LOG_ERR, "cannot flock(%s%s, fd=%d, type=%o, omode=%o, euid=%d)", - filename, ext, fd, type, omode, (int) geteuid()); + filename, ext, fd, type, omode, euid); # endif /* 0 */ + errno = save_errno; return false; } #endif /* !HASFLOCK */ |
