/* WARNING: the following works on Linux and SysV, but not BSD! */
sigaction(SIGCHLD, &sa, NULL);
+ /* Daemons should close all extra filehandles ... *before* RPC init. */
+ if (!foreground) {
+ int fd = sysconf (_SC_OPEN_MAX);
+ while (--fd > 2)
+ (void) close(fd);
+ }
+
if (nfs_version & 0x1)
rpc_init("mountd", MOUNTPROG, MOUNTVERS,
mount_dispatch, port);