aboutsummaryrefslogtreecommitdiff
path: root/src/util/service.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-11-04 11:17:09 +0100
committerChristian Grothoff <christian@grothoff.org>2018-11-04 11:17:09 +0100
commit3a4e51894442b7fdde457836c6f99d710e47b3f1 (patch)
tree6da5910686ded1c1f6d13423122ab6d60da39911 /src/util/service.c
parent31cc8a750f8df10f0a69a8ba9db08a15efa2f415 (diff)
downloadgnunet-3a4e51894442b7fdde457836c6f99d710e47b3f1.tar.gz
gnunet-3a4e51894442b7fdde457836c6f99d710e47b3f1.zip
fix #5454
Diffstat (limited to 'src/util/service.c')
-rw-r--r--src/util/service.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/util/service.c b/src/util/service.c
index 20cc1036d..ea34abc6c 100644
--- a/src/util/service.c
+++ b/src/util/service.c
@@ -1175,8 +1175,9 @@ setup_service (struct GNUNET_SERVICE_Handle *sh)
1175 const char *nfds; 1175 const char *nfds;
1176 unsigned int cnt; 1176 unsigned int cnt;
1177 int flags; 1177 int flags;
1178 char dummy[2];
1178#endif 1179#endif
1179 1180
1180 if (GNUNET_CONFIGURATION_have_value 1181 if (GNUNET_CONFIGURATION_have_value
1181 (sh->cfg, 1182 (sh->cfg,
1182 sh->service_name, 1183 sh->service_name,
@@ -1203,8 +1204,9 @@ setup_service (struct GNUNET_SERVICE_Handle *sh)
1203 errno = 0; 1204 errno = 0;
1204 if ( (NULL != (nfds = getenv ("LISTEN_FDS"))) && 1205 if ( (NULL != (nfds = getenv ("LISTEN_FDS"))) &&
1205 (1 == SSCANF (nfds, 1206 (1 == SSCANF (nfds,
1206 "%u", 1207 "%u%1s",
1207 &cnt)) && 1208 &cnt,
1209 dummy)) &&
1208 (cnt > 0) && 1210 (cnt > 0) &&
1209 (cnt < FD_SETSIZE) && 1211 (cnt < FD_SETSIZE) &&
1210 (cnt + 4 < FD_SETSIZE) ) 1212 (cnt + 4 < FD_SETSIZE) )