[dovecot-cvs] dovecot/src/lib file-dotlock.c, 1.28, 1.29 file-dotlock.h, 1.9, 1.10

cras at dovecot.org cras at dovecot.org
Fri Nov 25 17:15:14 EET 2005


Update of /var/lib/cvs/dovecot/src/lib
In directory talvi:/tmp/cvs-serv4496

Modified Files:
	file-dotlock.c file-dotlock.h 
Log Message:
Added file_dotlock_get_lock_path()



Index: file-dotlock.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/file-dotlock.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- file-dotlock.c	18 Sep 2005 17:31:41 -0000	1.28
+++ file-dotlock.c	25 Nov 2005 15:15:11 -0000	1.29
@@ -523,9 +523,7 @@
 	dotlock = *dotlock_p;
 	*dotlock_p = NULL;
 
-	lock_path = t_strconcat(dotlock->path,
-				dotlock->settings.lock_suffix, NULL);
-
+	lock_path = file_dotlock_get_lock_path(dotlock);
 	if (lstat(lock_path, &st) < 0) {
 		if (errno == ENOENT) {
 			i_warning("Our dotlock file %s was deleted "
@@ -611,8 +609,7 @@
 	if ((flags & DOTLOCK_REPLACE_FLAG_DONT_CLOSE_FD) != 0)
 		dotlock->fd = -1;
 
-	lock_path = t_strconcat(dotlock->path,
-				dotlock->settings.lock_suffix, NULL);
+	lock_path = file_dotlock_get_lock_path(dotlock);
 	if ((flags & DOTLOCK_REPLACE_FLAG_VERIFY_OWNER) != 0) {
 		if (fstat(fd, &st) < 0) {
 			i_error("fstat(%s) failed: %m", lock_path);
@@ -645,3 +642,8 @@
 	file_dotlock_free(dotlock);
 	return 1;
 }
+
+const char *file_dotlock_get_lock_path(struct dotlock *dotlock)
+{
+	return t_strconcat(dotlock->path, dotlock->settings.lock_suffix, NULL);
+}

Index: file-dotlock.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/file-dotlock.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- file-dotlock.h	28 Aug 2005 19:28:55 -0000	1.9
+++ file-dotlock.h	25 Nov 2005 15:15:11 -0000	1.10
@@ -69,4 +69,7 @@
 int file_dotlock_replace(struct dotlock **dotlock,
 			 enum dotlock_replace_flags flags);
 
+/* Returns the lock file path. */
+const char *file_dotlock_get_lock_path(struct dotlock *dotlock);
+
 #endif



More information about the dovecot-cvs mailing list