0
0
mirror of https://github.com/termux/termux-packages.git synced 2024-12-04 18:45:52 +00:00
termux-packages/packages/bash/examples-loadables-fdflags.c.patch
Fredrik Fornwall 911c23f40d
fix(main/bash): Replace getdtablesize() with sysconf(_SC_OPEN_MAX)
Fix the following build error found by the new symbol scanning:

> INFO: Found files with undefined symbols
> INFO: Showing result
> packages/bash/examples-loadables-fdflags.c.patch
> ERROR: ./lib/bash/fdflags contains undefined symbols:
>    16: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT   UND getdtablesize
2024-05-05 21:51:43 +02:00

13 lines
434 B
Diff

diff -u -r src/examples/loadables/fdflags.c src-upstream/examples/loadables/fdflags.c
--- src/examples/loadables/fdflags.c 2024-04-30 10:05:36.575401671 +0000
+++ src-upstream/examples/loadables/fdflags.c 2024-04-30 10:04:40.138338675 +0000
@@ -267,7 +267,7 @@
return maxfd;
#endif
- maxfd = getdtablesize ();
+ maxfd = sysconf(_SC_OPEN_MAX);
if (maxfd <= 0)
maxfd = HIGH_FD_MAX;
for (maxfd--; maxfd > 0; maxfd--)