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:
+2
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user