Hi,

The files

lib/spawn_faction_addopen.c
lib/spawn_faction_addclose.c
lib/spawn_faction_adddup2.c

contains this unusual pattern:

#if !_LIBC
# define __sysconf(open_max) getdtablesize ()
#endif
...
int maxfd = __sysconf (_SC_OPEN_MAX);

This is non-portable to new systems that doesn't have the non-standard
getdtablesize() function, but implements the standard sysconf value. The
desirable pattern would be to just use the real standard sysconf call
directly:

int maxfd = sysconf (_SC_OPEN_MAX);

Or, if it is desirable to support systems with no sysconf() and just
getdtablesize(), then:

#ifdef _SC_OPEN_MAX
int maxfd = sysconf (_SC_OPEN_MAX);
#else
int maxfd = getdtablesize ();
#endif

Jonas 'Sortie' Termansen

Reply via email to