From b29352eff64bd476b754284cea4fd794cdfc6f71 Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Sun, 18 Mar 2018 21:15:12 +0100 Subject: [PATCH] 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. --- src/gui/curses/headless/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/curses/headless/main.c b/src/gui/curses/headless/main.c index b19a3ffc7..871a4a30d 100644 --- a/src/gui/curses/headless/main.c +++ b/src/gui/curses/headless/main.c @@ -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); }