summaryrefslogtreecommitdiffstats
path: root/contrib/sendmail/libsmutil/lockfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/sendmail/libsmutil/lockfile.c')
-rw-r--r--contrib/sendmail/libsmutil/lockfile.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/contrib/sendmail/libsmutil/lockfile.c b/contrib/sendmail/libsmutil/lockfile.c
index 8c2dc6e..5eca360 100644
--- a/contrib/sendmail/libsmutil/lockfile.c
+++ b/contrib/sendmail/libsmutil/lockfile.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -11,13 +11,12 @@
*
*/
-#ifndef lint
-static char id[] = "@(#)$Id: lockfile.c,v 8.3.16.11 2000/11/16 02:54:28 geir Exp $";
-#endif /* ! lint */
-
#include <sendmail.h>
- /*
+SM_RCSID("@(#)$Id: lockfile.c,v 8.19 2001/09/11 04:04:55 gshapiro Exp $")
+
+
+/*
** LOCKFILE -- lock a file using flock or (shudder) fcntl locking
**
** Parameters:
@@ -30,8 +29,8 @@ static char id[] = "@(#)$Id: lockfile.c,v 8.3.16.11 2000/11/16 02:54:28 geir Exp
** LOCK_UN -- unlock.
**
** Returns:
-** TRUE if the lock was acquired.
-** FALSE otherwise.
+** true if the lock was acquired.
+** false otherwise.
*/
bool
@@ -59,7 +58,7 @@ lockfile(fd, filename, ext, type)
action = F_SETLKW;
if (fcntl(fd, action, &lfd) >= 0)
- return TRUE;
+ return true;
/*
** On SunOS, if you are testing using -oQ/tmp/mqueue or
@@ -71,14 +70,14 @@ lockfile(fd, filename, ext, type)
*/
if (errno == EINVAL)
- return TRUE;
+ return true;
#else /* !HASFLOCK */
if (flock(fd, type) >= 0)
- return TRUE;
+ return true;
#endif /* !HASFLOCK */
- return FALSE;
+ return false;
}
OpenPOWER on IntegriCloud