mirror of
https://github.com/weechat/weechat.git
synced 2026-06-25 04:16:38 +02:00
Replace getdtablesize() with sysconf(_SC_OPEN_MAX)
From the getdtablesize(3) man page:
It is not specified in POSIX.1; portable applications should
employ sysconf(_SC_OPEN_MAX) instead of this call.
Specifically, this fixes a compilation problem on Android.
This commit is contained in:
@@ -72,7 +72,7 @@ daemonize ()
|
||||
setsid ();
|
||||
|
||||
/* close all file descriptors */
|
||||
for (i = getdtablesize(); i >= 0; --i)
|
||||
for (i = sysconf(_SC_OPEN_MAX); i >= 0; --i)
|
||||
{
|
||||
close (i);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user