summaryrefslogtreecommitdiffstats
path: root/contrib/sendmail/libsmdb/smdb.c
diff options
context:
space:
mode:
authorgshapiro <gshapiro@FreeBSD.org>2002-04-10 03:05:00 +0000
committergshapiro <gshapiro@FreeBSD.org>2002-04-10 03:05:00 +0000
commit9e3bd35cd79720a6547b183a6a6fb97ab1ae7b84 (patch)
tree348e6162af337e0b74db963f6e4dcc567e2f99e9 /contrib/sendmail/libsmdb/smdb.c
parent1a7e50d796833cbb4346a251bc88555ea2c58e94 (diff)
downloadFreeBSD-src-9e3bd35cd79720a6547b183a6a6fb97ab1ae7b84.zip
FreeBSD-src-9e3bd35cd79720a6547b183a6a6fb97ab1ae7b84.tar.gz
Import sendmail 8.12.3
Diffstat (limited to 'contrib/sendmail/libsmdb/smdb.c')
-rw-r--r--contrib/sendmail/libsmdb/smdb.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/contrib/sendmail/libsmdb/smdb.c b/contrib/sendmail/libsmdb/smdb.c
index e4bc341..4598f33 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 */
OpenPOWER on IntegriCloud