aboutsummaryrefslogtreecommitdiff
path: root/src/util/service.c
diff options
context:
space:
mode:
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) )