aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--misc.c5
-rw-r--r--options.c6
-rw-r--r--push.c6
-rw-r--r--status.c4
4 files changed, 11 insertions, 10 deletions
diff --git a/misc.c b/misc.c
index 1f7f616..f5ce590 100644
--- a/misc.c
+++ b/misc.c
@@ -155,9 +155,8 @@ set_nice (int niceval)
{
#ifdef HAVE_NICE
errno = 0;
- nice (niceval);
- if (errno != 0)
- msg (M_WARN | M_ERRNO, "WARNING: nice %d failed", niceval);
+ if (nice (niceval) < 0 && errno != 0)
+ msg (M_WARN | M_ERRNO, "WARNING: nice %d failed: %s", niceval, strerror(errno));
else
msg (M_INFO, "nice %d succeeded", niceval);
#else
diff --git a/options.c b/options.c
index 3c20f5b..a717e1e 100644
--- a/options.c
+++ b/options.c
@@ -4014,7 +4014,7 @@ add_option (struct options *options,
{
if (options->inetd != -1)
{
- msg (msglevel, opterr);
+ msg (msglevel, "%s", opterr);
goto err;
}
else
@@ -4024,7 +4024,7 @@ add_option (struct options *options,
{
if (options->inetd != -1)
{
- msg (msglevel, opterr);
+ msg (msglevel, "%s", opterr);
goto err;
}
else
@@ -4034,7 +4034,7 @@ add_option (struct options *options,
{
if (name != NULL)
{
- msg (msglevel, opterr);
+ msg (msglevel, "%s", opterr);
goto err;
}
name = p[z];
diff --git a/push.c b/push.c
index 1320bec..40e64c3 100644
--- a/push.c
+++ b/push.c
@@ -179,7 +179,7 @@ send_push_reply (struct context *c)
const int safe_cap = BCAP (&buf) - extra;
bool push_sent = false;
- buf_printf (&buf, cmd);
+ buf_printf (&buf, "%s", cmd);
while (e)
{
@@ -196,7 +196,7 @@ send_push_reply (struct context *c)
push_sent = true;
multi_push = true;
buf_reset_len (&buf);
- buf_printf (&buf, cmd);
+ buf_printf (&buf, "%s", cmd);
}
}
if (BLEN (&buf) + l >= safe_cap)
@@ -232,7 +232,7 @@ send_push_reply (struct context *c)
bool status = false;
buf_reset_len (&buf);
- buf_printf (&buf, cmd);
+ buf_printf (&buf, "%s", cmd);
status = send_control_channel_string (c, BSTR(&buf), D_PUSH);
if (!status)
goto fail;
diff --git a/status.c b/status.c
index 92fc7bc..4bbea28 100644
--- a/status.c
+++ b/status.c
@@ -168,7 +168,9 @@ status_flush (struct status_output *so)
#if defined(HAVE_FTRUNCATE)
{
const off_t off = lseek (so->fd, (off_t)0, SEEK_CUR);
- ftruncate (so->fd, off);
+ if (ftruncate (so->fd, off) != 0) {
+ msg (M_WARN, "Failed to truncate status file: %s", strerror(errno));
+ }
}
#elif defined(HAVE_CHSIZE)
{