summaryrefslogtreecommitdiff
path: root/miscutils/update.c
diff options
context:
space:
mode:
authorPavel Roskin2000-09-28 20:52:55 +0000
committerPavel Roskin2000-09-28 20:52:55 +0000
commit43f3e6114c175a838161bfb547f469ecdb600c87 (patch)
tree2e0952a6b77d9acbcc232345489ef116fab7eab0 /miscutils/update.c
parent8d369e98a5f0fb7612b3d09ff889394bf7ec4f5c (diff)
downloadbusybox-43f3e6114c175a838161bfb547f469ecdb600c87.zip
busybox-43f3e6114c175a838161bfb547f469ecdb600c87.tar.gz
Fixes to allow compilation on systems with glibc 2.1.92
Diffstat (limited to 'miscutils/update.c')
-rw-r--r--miscutils/update.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/miscutils/update.c b/miscutils/update.c
index e9f4969..7279d83 100644
--- a/miscutils/update.c
+++ b/miscutils/update.c
@@ -72,7 +72,12 @@ extern int update_main(int argc, char **argv)
/* Become a proper daemon */
setsid();
chdir("/");
+#ifdef OPEN_MAX
for (pid = 0; pid < OPEN_MAX; pid++) close(pid);
+#else
+ /* glibc 2.1.92 requires using sysconf(_SC_OPEN_MAX) */
+ for (pid = 0; pid < sysconf(_SC_OPEN_MAX); pid++) close(pid);
+#endif
/*
* This is no longer necessary since 1.3.5x, but it will harmlessly