1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-10 17:23:13 +02:00

Handle return value for truncate() - only for debugging anyway..

This commit is contained in:
Bram Matthys
2018-04-22 17:35:36 +02:00
parent 33db0bf73e
commit 1c2da25573
+2 -1
View File
@@ -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);