aboutsummaryrefslogtreecommitdiff
path: root/src/start-stop-daemon/start-stop-daemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/start-stop-daemon/start-stop-daemon.c')
-rw-r--r--src/start-stop-daemon/start-stop-daemon.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/start-stop-daemon/start-stop-daemon.c b/src/start-stop-daemon/start-stop-daemon.c
index b3a8edca..56f85cba 100644
--- a/src/start-stop-daemon/start-stop-daemon.c
+++ b/src/start-stop-daemon/start-stop-daemon.c
@@ -1104,8 +1104,12 @@ int main(int argc, char **argv)
|| rc_yesno(getenv("EINFO_QUIET")))
dup2(stderr_fd, STDERR_FILENO);
+#ifdef HAVE_CLOSEFROM
+ closefrom(3);
+#else
for (i = getdtablesize() - 1; i >= 3; --i)
close(i);
+#endif
if (scheduler != NULL) {
int scheduler_index;