[dovecot-cvs] dovecot/src/lib file-dotlock.c, 1.15,
1.16 file-dotlock.h, 1.6, 1.7
cras at procontrol.fi
cras at procontrol.fi
Mon Jun 28 19:44:41 EEST 2004
- Previous message: [dovecot-cvs] dovecot/src/lib ostream-file.c, 1.26, 1.27 ostream.h,
1.7, 1.8
- Next message: [dovecot-cvs] dovecot/src/lib-index Makefile.am, 1.18,
1.19 mail-cache-compress.c, 1.2, 1.3 mail-cache-decisions.c,
NONE, 1.1 mail-cache-lookup.c, 1.6, 1.7 mail-cache-private.h,
1.3, 1.4 mail-cache-transaction.c, 1.6, 1.7 mail-cache.c, 1.32,
1.33 mail-cache.h, 1.11, 1.12 mail-index-sync-update.c, 1.30,
1.31 mail-index-sync.c, 1.24, 1.25 mail-index.h, 1.120, 1.121
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/dovecot/src/lib
In directory talvi:/tmp/cvs-serv30848
Modified Files:
file-dotlock.c file-dotlock.h
Log Message:
don't close dotlock fd if it's given as -1
Index: file-dotlock.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib/file-dotlock.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- file-dotlock.c 20 Jun 2004 11:46:10 -0000 1.15
+++ file-dotlock.c 28 Jun 2004 16:44:38 -0000 1.16
@@ -487,9 +487,11 @@
return -1;
}
}
- if (close(fd) < 0) {
- i_error("close(%s) failed: %m", lock_path);
- return -1;
+ if (fd != -1) {
+ if (close(fd) < 0) {
+ i_error("close(%s) failed: %m", lock_path);
+ return -1;
+ }
}
if (verify_owner) {
Index: file-dotlock.h
===================================================================
RCS file: /home/cvs/dovecot/src/lib/file-dotlock.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- file-dotlock.h 3 May 2004 22:08:26 -0000 1.6
+++ file-dotlock.h 28 Jun 2004 16:44:38 -0000 1.7
@@ -47,8 +47,9 @@
int (*callback)(unsigned int secs_left, int stale,
void *context),
void *context);
-/* Replaces path with path.lock file. Closes given fd. If verify_owner is TRUE,
- it checks that lock file hasn't been overwritten before renaming. */
+/* Replaces path with path.lock file. If verify_owner is TRUE, it checks that
+ lock file hasn't been overwritten before renaming. Closes given fd, unless
+ it's given as -1 in which case verify_owner must be FALSE. */
int file_dotlock_replace(const char *path, const char *lock_suffix,
int fd, int verify_owner);
/* Like file_unlock_dotlock(). Closes given fd. */
- Previous message: [dovecot-cvs] dovecot/src/lib ostream-file.c, 1.26, 1.27 ostream.h,
1.7, 1.8
- Next message: [dovecot-cvs] dovecot/src/lib-index Makefile.am, 1.18,
1.19 mail-cache-compress.c, 1.2, 1.3 mail-cache-decisions.c,
NONE, 1.1 mail-cache-lookup.c, 1.6, 1.7 mail-cache-private.h,
1.3, 1.4 mail-cache-transaction.c, 1.6, 1.7 mail-cache.c, 1.32,
1.33 mail-cache.h, 1.11, 1.12 mail-index-sync-update.c, 1.30,
1.31 mail-index-sync.c, 1.24, 1.25 mail-index.h, 1.120, 1.121
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the dovecot-cvs
mailing list