dovecot-2.2: lib: Added file_lock_find() to find which process h...

dovecot at dovecot.org dovecot at dovecot.org
Thu Oct 9 15:15:23 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/d162eabd72cc
changeset: 17920:d162eabd72cc
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Oct 09 18:12:14 2014 +0300
description:
lib: Added file_lock_find() to find which process has a file locked.

diffstat:

 src/lib/file-lock.c |  4 ++--
 src/lib/file-lock.h |  5 +++++
 2 files changed, 7 insertions(+), 2 deletions(-)

diffs (27 lines):

diff -r 0221a504683c -r d162eabd72cc src/lib/file-lock.c
--- a/src/lib/file-lock.c	Thu Oct 09 16:51:22 2014 +0300
+++ b/src/lib/file-lock.c	Thu Oct 09 18:12:14 2014 +0300
@@ -131,8 +131,8 @@
 #endif
 }
 
-static const char *
-file_lock_find(int lock_fd, enum file_lock_method lock_method, int lock_type)
+const char *file_lock_find(int lock_fd, enum file_lock_method lock_method,
+			   int lock_type)
 {
 	const char *ret;
 
diff -r 0221a504683c -r d162eabd72cc src/lib/file-lock.h
--- a/src/lib/file-lock.h	Thu Oct 09 16:51:22 2014 +0300
+++ b/src/lib/file-lock.h	Thu Oct 09 18:12:14 2014 +0300
@@ -50,4 +50,9 @@
 /* Free the lock without unlocking it (because you're closing the fd anyway). */
 void file_lock_free(struct file_lock **lock);
 
+/* Returns human-readable string containing the process that has the file
+   currently locked. Returns "" if unknown, otherwise " (string)". */
+const char *file_lock_find(int lock_fd, enum file_lock_method lock_method,
+			   int lock_type);
+
 #endif


More information about the dovecot-cvs mailing list