X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Fliblutil%2Flockf.c;h=b808e6abdb7d58c04cd99cc204a73109108e198c;hb=f2a02b90edde2dbecb342f040603ffac72d99c36;hp=3daf88c695152a994c42babdd099286ea78177dc;hpb=598b7473fea63177f65d94a354a9336c6d136097;p=openldap
diff --git a/libraries/liblutil/lockf.c b/libraries/liblutil/lockf.c
index 3daf88c695..b808e6abdb 100644
--- a/libraries/liblutil/lockf.c
+++ b/libraries/liblutil/lockf.c
@@ -1,11 +1,16 @@
-/*
- * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA
+/* $OpenLDAP$ */
+/* This work is part of OpenLDAP Software .
+ *
+ * Copyright 1998-2007 The OpenLDAP Foundation.
* All rights reserved.
*
- * Redistribution and use in source and binary forms are permitted only
- * as authorized by the OpenLDAP Public License. A copy of this
- * license is available at http://www.OpenLDAP.org/license.html or
- * in file LICENSE in the top-level directory of the distribution.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted only as authorized by the OpenLDAP
+ * Public License.
+ *
+ * A copy of this license is available in the file LICENSE in the
+ * top-level directory of the distribution or, alternatively, at
+ * .
*/
/*
@@ -51,6 +56,18 @@
# define LOCK_API "flock"
#endif
+#if !defined(USE_LOCKF) && !defined(USE_FCNTL) && !defined(USE_FLOCK)
+int lutil_lockf ( int fd ) {
+ fd = fd;
+ return 0;
+}
+
+int lutil_unlockf ( int fd ) {
+ fd = fd;
+ return 0;
+}
+#endif
+
#ifdef USE_LOCKF
int lutil_lockf ( int fd ) {
/* use F_LOCK instead of F_TLOCK, ie: block */
@@ -66,7 +83,7 @@ int lutil_unlockf ( int fd ) {
int lutil_lockf ( int fd ) {
struct flock file_lock;
- memset( &file_lock, 0, sizeof( file_lock ) );
+ memset( &file_lock, '\0', sizeof( file_lock ) );
file_lock.l_type = F_WRLCK;
file_lock.l_whence = SEEK_SET;
file_lock.l_start = 0;
@@ -79,7 +96,7 @@ int lutil_lockf ( int fd ) {
int lutil_unlockf ( int fd ) {
struct flock file_lock;
- memset( &file_lock, 0, sizeof( file_lock ) );
+ memset( &file_lock, '\0', sizeof( file_lock ) );
file_lock.l_type = F_UNLCK;
file_lock.l_whence = SEEK_SET;
file_lock.l_start = 0;