*/
static int in_shutdown;
+/**
+ * Return value from main
+ */
+static int global_ret;
+
/**
* Are we starting user services?
*/
else
final_option = GNUNET_CONFIGURATION_expand_dollar (cfg,
final_option);
- if (GNUNET_YES ==
- GNUNET_CONFIGURATION_get_value_yesno (cfg,
+ start_user = GNUNET_CONFIGURATION_get_value_yesno (cfg,
"ARM",
- "USER_ONLY"))
- {
- GNUNET_break (GNUNET_YES == start_user);
- start_system = GNUNET_NO;
- }
- if (GNUNET_YES ==
- GNUNET_CONFIGURATION_get_value_yesno (cfg,
+ "USER_ONLY");
+ start_system = GNUNET_CONFIGURATION_get_value_yesno (cfg,
"ARM",
- "SYSTEM_ONLY"))
+ "SYSTEM_ONLY");
+ if ( (GNUNET_NO == start_user) &&
+ (GNUNET_NO == start_system) )
{
- GNUNET_break (GNUNET_YES == start_system);
- start_user = GNUNET_NO;
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Please configure either USER_ONLY or SYSTEM_ONLY or both.\n");
+ GNUNET_SCHEDULER_shutdown ();
+ global_ret = 1;
+ return;
}
GNUNET_CONFIGURATION_iterate_sections (cfg,
&setup_service,
main (int argc,
char *const *argv)
{
- int ret;
struct GNUNET_SIGNAL_Context *shc_chld;
struct GNUNET_MQ_MessageHandler handlers[] = {
GNUNET_MQ_hd_var_size (start,
shc_chld =
GNUNET_SIGNAL_handler_install (GNUNET_SIGCHLD,
&sighandler_child_death);
- ret = GNUNET_SERVICE_run_ (argc,
+ if ( GNUNET_OK != GNUNET_SERVICE_run_ (argc,
argv,
"arm",
GNUNET_SERVICE_OPTION_MANUAL_SHUTDOWN,
&client_connect_cb,
&client_disconnect_cb,
NULL,
- handlers);
+ handlers))
+ global_ret = 2;
#if HAVE_WAIT4
if (NULL != wait_file)
{
shc_chld = NULL;
GNUNET_DISK_pipe_close (sigpipe);
sigpipe = NULL;
- return ret;
+ return global_ret;
}