[dovecot-cvs] dovecot/src/lib file-dotlock.c,1.32,1.33

cras at dovecot.org cras at dovecot.org
Sat Apr 1 00:19:23 EEST 2006


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

Modified Files:
	file-dotlock.c 
Log Message:
Added some t_push/t_pop calls



Index: file-dotlock.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/file-dotlock.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- file-dotlock.c	5 Feb 2006 12:58:05 -0000	1.32
+++ file-dotlock.c	31 Mar 2006 21:19:20 -0000	1.33
@@ -480,12 +480,14 @@
 
 	*dotlock_r = NULL;
 
+	t_push();
 	dotlock = file_dotlock_alloc(set);
 	lock_path = t_strconcat(path, dotlock->settings.lock_suffix, NULL);
 
 	ret = dotlock_create(path, dotlock, flags, TRUE);
 	if (ret <= 0 || (flags & DOTLOCK_CREATE_FLAG_CHECKONLY) != 0) {
-		i_free(dotlock);
+		file_dotlock_free(dotlock);
+		t_pop();
 		return ret;
 	}
 
@@ -495,6 +497,7 @@
 	if (close(fd) < 0) {
 		i_error("close(%s) failed: %m", lock_path);
 		file_dotlock_free(dotlock);
+		t_pop();
 		return -1;
 	}
 
@@ -503,6 +506,7 @@
 	if (stat(lock_path, &st) < 0) {
 		i_error("stat(%s) failed: %m", lock_path);
                 file_dotlock_free(dotlock);
+		t_pop();
 		return -1;
 	}
 	/* extra sanity check won't hurt.. */
@@ -510,11 +514,13 @@
 		i_error("dotlock %s was immediately recreated under us",
 			lock_path);
                 file_dotlock_free(dotlock);
+		t_pop();
 		return -1;
 	}
 	dotlock->mtime = st.st_mtime;
 
 	*dotlock_r = dotlock;
+	t_pop();
 	return 1;
 }
 
@@ -587,7 +593,10 @@
 
 	dotlock = file_dotlock_alloc(set);
 
+	t_push();
 	ret = dotlock_create(path, dotlock, flags, FALSE);
+	t_pop();
+
 	if (ret <= 0) {
 		file_dotlock_free(dotlock);
 		*dotlock_r = NULL;



More information about the dovecot-cvs mailing list