dovecot-2.2: lib: failures - cosmetic write_full cleanup

dovecot at dovecot.org dovecot at dovecot.org
Fri Jul 4 11:50:52 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/189f97de7ffa
changeset: 17604:189f97de7ffa
user:      Phil Carmody <phil at dovecot.fi>
date:      Fri Jul 04 14:48:44 2014 +0300
description:
lib: failures - cosmetic write_full cleanup
Error message should have a trailing newline.
Use the POSIX macro for stderr's file number, rather than its numeric value.

Signed-off-by: Phil Carmody <phil at dovecot.fi>

diffstat:

 src/lib/failures.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r aee2ce74afa8 -r 189f97de7ffa src/lib/failures.c
--- a/src/lib/failures.c	Fri Jul 04 14:18:25 2014 +0300
+++ b/src/lib/failures.c	Fri Jul 04 14:48:44 2014 +0300
@@ -457,7 +457,7 @@
 
 	if (*fd != STDERR_FILENO) {
 		if (close(*fd) < 0) {
-			str = t_strdup_printf("close(%d) failed: %m", *fd);
+			str = t_strdup_printf("close(%d) failed: %m\n", *fd);
 			(void)write_full(STDERR_FILENO, str, strlen(str));
 		}
 	}
@@ -516,7 +516,7 @@
 
 	str = t_strdup_printf("\001%c%s %s=%s\n", LOG_TYPE_OPTION+1,
 			      my_pid, key, value);
-	(void)write_full(2, str, strlen(str));
+	(void)write_full(STDERR_FILENO, str, strlen(str));
 }
 
 void i_set_failure_prefix(const char *prefix_fmt, ...)


More information about the dovecot-cvs mailing list