Set the close-on-exec flag, just to be saf
authorEric Andersen <andersen@codepoet.org>
Mon, 30 Sep 2002 20:08:53 +0000 (20:08 -0000)
committerEric Andersen <andersen@codepoet.org>
Mon, 30 Sep 2002 20:08:53 +0000 (20:08 -0000)
init/init.c

index 989babff7f0d69766040670cdadda8dc3f616eac..3b0a66a247c78fd22c551841e256c097bd53b971 100644 (file)
@@ -232,6 +232,8 @@ static void message(int device, char *fmt, ...)
                        log_fd = -2;
                        fprintf(stderr, "Bummer, can't write to log on %s!\n", log);
                        device = CONSOLE;
+               } else {
+                       fcntl(log_fd, F_SETFD, FD_CLOEXEC);
                }
        }
        if ((device & LOG) && (log_fd >= 0)) {