summaryrefslogtreecommitdiffstats
path: root/usr.sbin/inetd
diff options
context:
space:
mode:
authorotto <otto@openbsd.org>2009-11-02 20:03:01 +0000
committerotto <otto@openbsd.org>2009-11-02 20:03:01 +0000
commit51a9e7d75967c16541617937d318080f16bd3bb0 (patch)
tree09227cb4d3af28527143b8714c460e0bf5b1dd42 /usr.sbin/inetd
parentRemove unused member(s) of `struct acpi_softc'. (diff)
downloadwireguard-openbsd-51a9e7d75967c16541617937d318080f16bd3bb0.tar.xz
wireguard-openbsd-51a9e7d75967c16541617937d318080f16bd3bb0.zip
we have closefrom(2), so use it; ok deraadt@ tedu@
Diffstat (limited to 'usr.sbin/inetd')
-rw-r--r--usr.sbin/inetd/inetd.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/usr.sbin/inetd/inetd.c b/usr.sbin/inetd/inetd.c
index 12b42897c9b..a6c5a5f3ab8 100644
--- a/usr.sbin/inetd/inetd.c
+++ b/usr.sbin/inetd/inetd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: inetd.c,v 1.131 2009/10/27 23:59:51 deraadt Exp $ */
+/* $OpenBSD: inetd.c,v 1.132 2009/11/02 20:03:01 otto Exp $ */
/*
* Copyright (c) 1983,1991 The Regents of the University of California.
@@ -1977,8 +1977,7 @@ spawn(struct servtab *sep, int ctrl)
dup2(STDIN_FILENO, STDOUT_FILENO);
dup2(STDIN_FILENO, STDERR_FILENO);
closelog();
- for (tmpint = rlim_nofile_cur-1; --tmpint > 2; )
- (void)close(tmpint);
+ closefrom(3);
sigaction(SIGPIPE, &sapipe, NULL);
execv(sep->se_server, sep->se_argv);
if (sep->se_socktype != SOCK_STREAM)