starter: Do not close all file descriptors after fork()
authorMartin Willi <martin@revosec.ch>
Fri, 11 Jul 2014 12:40:56 +0000 (14:40 +0200)
committerMartin Willi <martin@revosec.ch>
Mon, 25 Aug 2014 07:47:46 +0000 (09:47 +0200)
As we use libstrongswan and expect that it still works after the fork, we
can't just closefrom() all file descriptors. Watcher, for example, uses
a pipe to notify FDSET changes, which must be kept open.

Reverts 652ddf5ce2fad08f6569096dd56a821500cc5ba4.

src/starter/starter.c

index ef57808..71f33ae 100644 (file)
@@ -612,7 +612,6 @@ int main (int argc, char **argv)
                                int fnull;
 
                                close_log();
-                               closefrom(3);
 
                                fnull = open("/dev/null", O_RDWR);
                                if (fnull >= 0)