aboutsummaryrefslogtreecommitdiff
path: root/src/inetd-bi.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2014-12-27 00:46:32 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2014-12-27 00:51:54 +0200
commitcb8b9461907373485acabb90bc1cad5263abc8b8 (patch)
tree63c9a28993791d8b836685a6d01c608ba604e0d3 /src/inetd-bi.c
parenta1d8a2d3662cde5f1d0ec411e372c3614bb49a6d (diff)
downloadpies-cb8b9461907373485acabb90bc1cad5263abc8b8.tar.gz
pies-cb8b9461907373485acabb90bc1cad5263abc8b8.tar.bz2
Minor fixes.
* lib/proctitle.c (mf_proctitle_format): Check return from vasprintf instead of checking the return pointer. * src/inetd-bi.c: Check return values from write where reasonable. * src/progman.c (redirect_to_file): Check return from chown. (close_fds): Fix coredump (upper boundary was wrong). (open_redirector, progman_dump_stats): Check return values. * src/sysvinit.c (sysvinit_setenv): Remove unused variable. * src/userprivs.c (str_eq, str_dispose): Remove unused functions. * src/utmp.c: Check return values.
Diffstat (limited to 'src/inetd-bi.c')
-rw-r--r--src/inetd-bi.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/inetd-bi.c b/src/inetd-bi.c
index a579fbb..e472390 100644
--- a/src/inetd-bi.c
+++ b/src/inetd-bi.c
@@ -93,7 +93,8 @@ static void
time_stream (int fd, struct component const *comp)
{
unsigned long result = time_since_1900 ();
- write (fd, (char *) &result, sizeof result);
+ if (write (fd, (char *) &result, sizeof result) == -1)
+ logmsg (LOG_ERR, "write: %s", strerror (errno));
}
static void
@@ -118,7 +119,8 @@ daytime_stream (int fd, struct component const *comp)
time (&now);
sprintf (buffer, "%.24s\r\n", ctime (&now));
- write (fd, buffer, strlen (buffer));
+ if (write (fd, buffer, strlen (buffer)) == -1)
+ logmsg (LOG_ERR, "write: %s", strerror (errno));
}
static void
@@ -251,7 +253,8 @@ qotd_stream (int fd, struct component const *comp)
{
char text[QOTD_MAX];
size_t len = qotd_read (text);
- write (fd, text, len);
+ if (write (fd, text, len) == -1)
+ logmsg (LOG_ERR, "write: %s", strerror (errno));
}
static void

Return to:

Send suggestions and report system problems to the System administrator.