static int default_log_handler(struct log_stream *ls UNUSED, struct log_msg *m)
{
// This is a completely bare version of the log-file module. Errors are ignored.
- write(2, m->m, m->m_len);
+ if (write(2, m->m, m->m_len) < 0)
+ {
+ }
return 0;
}
#ifdef LOCAL_DEBUG
msg(L_DEBUG | L_SIGHANDLER, "MAIN: Sigpipe: sending signal %d down the drain", signum);
#endif
- write(m->sig_pipe_send, &signum, sizeof(signum));
+ if (write(m->sig_pipe_send, &signum, sizeof(signum)) < 0)
+ {
+ }
}
void
static void
parse_section(struct section *section)
{
-#define TRY(x) do{byte *_err=(x); if (_err) die(_err); }while(0)
+#define TRY(x) do{ byte *_err=(x); if (_err) die("%s", _err); }while(0)
for (uns sep = 0; ; sep = 1)
{
parse_white();
die("Unknown logging level `%s'", argv[2]);
if (argc > 3)
- msg(level, argv[3]);
+ msg(level, "%s", argv[3]);
else
while (fgets(buf, sizeof(buf), stdin))
{
c = strchr(buf, '\n');
if (c)
*c = 0;
- msg(level, buf);
+ msg(level, "%s", buf);
}
return 0;
}
}
}
if (help) {
- write(2, usage, sizeof(usage));
+ if (write(2, usage, sizeof(usage)) < 0) {
+ }
return (help == 1) ? 0 : 1;
}