[dovecot-cvs] dovecot/src/lib failures.c,1.27,1.28

cras at dovecot.org cras at dovecot.org
Sun Jul 2 16:47:03 EEST 2006


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

Modified Files:
	failures.c 
Log Message:
If writing to log file fails, restore errno before %m is used. Although the 
log writing most likely fails anyway at that point, but at least strace logs  
show it right. :) 



Index: failures.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/failures.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- failures.c	16 Oct 2005 10:37:18 -0000	1.27
+++ failures.c	2 Jul 2006 13:47:01 -0000	1.28
@@ -93,8 +93,12 @@
 		fputs(format, f);
 	} else {
 		write_prefix(f);
-
 		fputs(prefix, f);
+
+		/* write may have failed, restore errno so %m works. although
+		   it probably can't write the error then anyway. */
+		errno = old_errno;
+
 		/* make sure there's no %n in there and fix %m */
                 (void)printf_string_upper_bound(&format, args);
 		vfprintf(f, format, args2);



More information about the dovecot-cvs mailing list