summaryrefslogtreecommitdiff
path: root/glib/gspawn.c
diff options
context:
space:
mode:
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2022-10-19 16:28:18 +0200
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2022-10-20 16:12:39 +0200
commit3e2dda55a2f2cefb93eb001d685b5aed07e1feb1 (patch)
treee8da34d522c5b2d4cb49eb87e23c1dc94668bc4e /glib/gspawn.c
parent62b5c727feeb254931cea2269395d63ecc7c34cd (diff)
downloadglib-wip/3v1n0/more-unix-oses.tar.gz
glib: Add generic G_OS_BSD definition on such platformswip/3v1n0/more-unix-oses
There is some downstream code and our tests that may at times need to check for all BSD kinds, so just a more generic way to handle this
Diffstat (limited to 'glib/gspawn.c')
-rw-r--r--glib/gspawn.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/glib/gspawn.c b/glib/gspawn.c
index 28c277444..26914cf03 100644
--- a/glib/gspawn.c
+++ b/glib/gspawn.c
@@ -1475,7 +1475,7 @@ safe_fdwalk (int (*cb)(void *data, int fd), void *data)
if (getrlimit (RLIMIT_NOFILE, &rl) == 0 && rl.rlim_max != RLIM_INFINITY)
open_max = rl.rlim_max;
#endif
-#if defined(G_OS_FREEBSD) || defined(G_OS_OPENBSD) || defined(G_OS_DARWIN)
+#ifdef G_OS_BSD
/* Use sysconf() function provided by the system if it is known to be
* async-signal safe.
*
@@ -1490,7 +1490,7 @@ safe_fdwalk (int (*cb)(void *data, int fd), void *data)
*/
if (open_max < 0)
open_max = sysconf (_SC_OPEN_MAX);
-#endif
+#endif /* G_OS_BSD */
/* Hardcoded fallback: the default process hard limit in Linux as of 2020 */
if (open_max < 0)
open_max = 4096;