[PATCH 01/10] logger: ensure program writes everything to syslog file descriptor

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It is fair assumption messages an user is asking to be wrote will be
attempted to be wrote as hard as possible.

Signed-off-by: Sami Kerola <kerolasa@xxxxxx>
---
 misc-utils/logger.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/misc-utils/logger.c b/misc-utils/logger.c
index a862e55..6604d1a 100644
--- a/misc-utils/logger.c
+++ b/misc-utils/logger.c
@@ -51,6 +51,7 @@
 #include <netdb.h>
 #include <getopt.h>
 
+#include "all-io.h"
 #include "c.h"
 #include "closestream.h"
 #include "nls.h"
@@ -281,8 +282,8 @@ static void mysyslog(int fd, int logflags, int pri, char *tag, char *msg)
                snprintf(buf, sizeof(buf), "<%d>%.15s %.200s%s: %.400s",
 			pri, tp, cp, pid, msg);
 
-               if (write(fd, buf, strlen(buf)+1) < 0)
-                       return; /* error */
+	       if (write_all(fd, buf, strlen(buf)+1) < 0)
+		       warn(_("write failed"));
        }
 }
 
-- 
2.0.2

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux