Try to use FD_CLOEXEC instead of mass-closing everywhere.
[ashd.git] / src / accesslog.c
index 5b0c708..02e5f1a 100644 (file)
@@ -273,6 +273,7 @@ static void reopenlog(void)
 static void usage(FILE *out)
 {
     fprintf(out, "usage: accesslog [-hFaL] [-f FORMAT] [-p PIDFILE] OUTFILE CHILD [ARGS...]\n");
+    fprintf(out, "       accesslog -P LOGFILE\n");
 }
 
 int main(int argc, char **argv)
@@ -341,6 +342,7 @@ int main(int argc, char **argv)
            }
        }
     }
+    fcntl(fileno(out), F_SETFD, FD_CLOEXEC);
     if((ch = stdmkchild(argv + optind + 1, NULL, NULL)) < 0) {
        flog(LOG_ERR, "accesslog: could not fork child: %s", strerror(errno));
        exit(1);