mirror of
https://github.com/termux/termux-packages.git
synced 2025-08-15 17:03:11 +00:00
18 lines
383 B
Diff
18 lines
383 B
Diff
diff --git a/src/misc.c b/src/misc.c
|
|
index 2690923..cf9d4a7 100644
|
|
--- a/misc.c
|
|
+++ b/misc.c
|
|
@@ -156,8 +156,11 @@ void closeallfiles(int except)
|
|
int maxfd, i, fd, ret, z;
|
|
|
|
i = 3; /* skip stdin, stdout and stderr */
|
|
+ #if defined(__ANDROID__)
|
|
+ maxfd = sysconf(_SC_OPEN_MAX);
|
|
+ #else
|
|
maxfd = getdtablesize();
|
|
-
|
|
+ #endif
|
|
while (i < maxfd) {
|
|
memset(pfd, 0, sizeof(pfd));
|
|
|