From 43f3e6114c175a838161bfb547f469ecdb600c87 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Thu, 28 Sep 2000 20:52:55 +0000 Subject: Fixes to allow compilation on systems with glibc 2.1.92 --- miscutils/update.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'miscutils') diff --git a/miscutils/update.c b/miscutils/update.c index e9f496913..7279d83a8 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 -- cgit v1.2.3