diff -ur uptimed-0.3.16/configure.ac uptimed-0.3.16.modified/configure.ac --- uptimed-0.3.16/configure.ac 2009-01-02 00:46:00.000000000 +0100 +++ uptimed-0.3.16.modified/configure.ac 2011-11-01 22:45:58.000000000 +0100 @@ -31,6 +31,9 @@ *-darwin*) AC_DEFINE(PLATFORM_BSD, 1, [Define if you are compiling for *BSD]) ;; + *-gnu*) + AC_DEFINE(PLATFORM_GNU, 1, [Define if you are compiling for *GNU]) + ;; *) AC_DEFINE(PLATFORM_UNKNOWN, 1, [Define if you are compiling for an unknown system]) ;; @@ -38,6 +41,7 @@ AC_REPLACE_FUNCS(getopt) AC_CHECK_HEADERS(getopt.h) +AC_CHECK_FUNCS([getdtablesize]) AC_OUTPUT([Makefile libuptimed/Makefile src/Makefile man/Makefile etc/Makefile uptimed.spec]) diff -ur uptimed-0.3.16/src/uptimed.c uptimed-0.3.16.modified/src/uptimed.c --- uptimed-0.3.16/src/uptimed.c 2009-01-02 00:46:00.000000000 +0100 +++ uptimed-0.3.16.modified/src/uptimed.c 2011-11-01 23:00:14.000000000 +0100 @@ -175,7 +175,7 @@ void bg(void) { - int i; + int i, fdmax; /* Simple fork to run proces in the background. */ switch(fork()) { @@ -192,7 +192,15 @@ } /* Close probably all file descriptors */ - for (i = 0; i