diff --git a/src/ircd.c b/src/ircd.c index 0e4099713..0f9bbe746 100644 --- a/src/ircd.c +++ b/src/ircd.c @@ -1627,7 +1627,8 @@ static void open_debugfile(void) /*(void)printf("isatty = %d ttyname = %#x\n", isatty(2), (u_int)ttyname(2)); */ if (!(bootopt & BOOT_TTY)) { /* leave debugging output on fd 2 */ - (void)truncate(LOGFILE, 0); + if (truncate(LOGFILE, 0) < 0) + fprintf(stderr, "WARNING: could not truncate log file '%s'\n", LOGFILE); if ((fd = open(LOGFILE, O_WRONLY | O_CREAT, 0600)) < 0) if ((fd = open("/dev/null", O_WRONLY)) < 0) exit(-1);