X-Git-Url: https://vcs.fsf.org/?p=exim.git;a=blobdiff_plain;f=src%2Fsrc%2Flog.c;h=6eb57ca750fe8bc6c7ea860ce2ea537b67009375;hp=fbf1042e751f54143962b8259812625db8ea4c50;hb=9cd319d9824c189921fce90ab8c37cff4f09c395;hpb=c193398df07b9917b917b38030c4544271024474 diff --git a/src/src/log.c b/src/src/log.c index fbf1042e7..6eb57ca75 100644 --- a/src/src/log.c +++ b/src/src/log.c @@ -663,6 +663,14 @@ while ((t = string_nextinlist(&tt, &sep, log_buffer, LOG_BUFFER_SIZE))) } +void +mainlog_close(void) +{ +if (mainlogfd < 0) return; +(void)close(mainlogfd); +mainlogfd = -1; +mainlog_inode = 0; +} /************************************************* * Write message to log file * @@ -1004,14 +1012,8 @@ if ( flags & LOG_MAIN happening. */ if (mainlogfd >= 0) - { if (Ustat(mainlog_name, &statbuf) < 0 || statbuf.st_ino != mainlog_inode) - { - (void)close(mainlogfd); - mainlogfd = -1; - mainlog_inode = 0; - } - } + mainlog_close(); /* If the log is closed, open it. Then write the line. */