diff options
Diffstat (limited to 'src/util/service.c')
-rw-r--r-- | src/util/service.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/util/service.c b/src/util/service.c index 20cc1036d..b61168570 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) ) |
@@ -1813,8 +1815,9 @@ GNUNET_SERVICE_run_ (int argc, | |||
1813 | opt_cfg_filename = GNUNET_strdup (cfg_filename); | 1815 | opt_cfg_filename = GNUNET_strdup (cfg_filename); |
1814 | if (GNUNET_YES == GNUNET_DISK_file_test (opt_cfg_filename)) | 1816 | if (GNUNET_YES == GNUNET_DISK_file_test (opt_cfg_filename)) |
1815 | { | 1817 | { |
1816 | if (GNUNET_SYSERR == GNUNET_CONFIGURATION_load (cfg, | 1818 | if (GNUNET_SYSERR == |
1817 | opt_cfg_filename)) | 1819 | GNUNET_CONFIGURATION_load (cfg, |
1820 | opt_cfg_filename)) | ||
1818 | { | 1821 | { |
1819 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 1822 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
1820 | _("Malformed configuration file `%s', exit ...\n"), | 1823 | _("Malformed configuration file `%s', exit ...\n"), |
@@ -1824,8 +1827,9 @@ GNUNET_SERVICE_run_ (int argc, | |||
1824 | } | 1827 | } |
1825 | else | 1828 | else |
1826 | { | 1829 | { |
1827 | if (GNUNET_SYSERR == GNUNET_CONFIGURATION_load (cfg, | 1830 | if (GNUNET_SYSERR == |
1828 | NULL)) | 1831 | GNUNET_CONFIGURATION_load (cfg, |
1832 | NULL)) | ||
1829 | { | 1833 | { |
1830 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 1834 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
1831 | _("Malformed configuration, exit ...\n")); | 1835 | _("Malformed configuration, exit ...\n")); |