changeset 17604:189f97de7ffa

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@dovecot.fi>
author Phil Carmody <phil@dovecot.fi>
date Fri, 04 Jul 2014 14:48:44 +0300
parents aee2ce74afa8
children dffc6dd2be0d
files src/lib/failures.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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, ...)