summaryrefslogtreecommitdiffstats
path: root/plugins/runcmd.c
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2019-07-18 06:40:35 (GMT)
committerAndreas Baumann <mail@andreasbaumann.cc>2019-07-18 06:40:35 (GMT)
commit34cc70c3c6428ba0d1f42994f5f0d6b4b8fc8711 (patch)
treec434bba834da4b42c85d00a2083c205307c8d55a /plugins/runcmd.c
parent2f4d6764d78cf085601b34ac92486405bd11095d (diff)
parente8325b39c47e6fbf7c8c1e31f9026870d9520af5 (diff)
downloadmonitoring-plugins-34cc70c3c6428ba0d1f42994f5f0d6b4b8fc8711.tar.gz
Merge branch 'master' into feature_check_curl
Diffstat (limited to 'plugins/runcmd.c')
-rw-r--r--plugins/runcmd.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/plugins/runcmd.c b/plugins/runcmd.c
index c382867..a7155d2 100644
--- a/plugins/runcmd.c
+++ b/plugins/runcmd.c
@@ -86,14 +86,8 @@ extern void die (int, const char *, ...)
86 * through this api and thus achieve async-safeness throughout the api */ 86 * through this api and thus achieve async-safeness throughout the api */
87void np_runcmd_init(void) 87void np_runcmd_init(void)
88{ 88{
89#ifndef maxfd 89 if(maxfd == 0)
90 if(!maxfd && (maxfd = sysconf(_SC_OPEN_MAX)) < 0) { 90 maxfd = open_max();
91 /* possibly log or emit a warning here, since there's no
92 * guarantee that our guess at maxfd will be adequate */
93 maxfd = 256;
94 }
95#endif
96
97 if(!np_pids) np_pids = calloc(maxfd, sizeof(pid_t)); 91 if(!np_pids) np_pids = calloc(maxfd, sizeof(pid_t));
98} 92}
99 93