projects
/
oweals
/
gnunet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
30c5c32
)
start gnunet-service-arm nicely if configuration file does not exist
author
Christian Grothoff
<christian@grothoff.org>
Fri, 25 Jan 2013 16:02:41 +0000
(16:02 +0000)
committer
Christian Grothoff
<christian@grothoff.org>
Fri, 25 Jan 2013 16:02:41 +0000
(16:02 +0000)
src/arm/arm_api.c
patch
|
blob
|
history
diff --git
a/src/arm/arm_api.c
b/src/arm/arm_api.c
index 517938d8c8c5dbe57861f78015daaec03464b77d..fd49a18a5aaded165b29a6005c44e51d37703636 100644
(file)
--- a/
src/arm/arm_api.c
+++ b/
src/arm/arm_api.c
@@
-359,17
+359,7
@@
arm_service_report (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_filename (pos->h->cfg, "arm", "CONFIG",
&config))
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_filename (pos->h->cfg, "arm", "CONFIG",
&config))
- {
- GNUNET_log_config_missing (GNUNET_ERROR_TYPE_WARNING,
- "arm", "CONFIG");
- if (pos->callback != NULL)
- pos->callback (pos->cls, GNUNET_ARM_PROCESS_UNKNOWN);
- GNUNET_free (cbinary);
- GNUNET_free (pos);
- GNUNET_free (loprefix);
- GNUNET_free (lopostfix);
- return;
- }
+ config = NULL;
binary = GNUNET_OS_get_libexec_binary_path (cbinary);
GNUNET_free (cbinary);
if ((GNUNET_YES ==
binary = GNUNET_OS_get_libexec_binary_path (cbinary);
GNUNET_free (cbinary);
if ((GNUNET_YES ==
@@
-383,28
+373,39
@@
arm_service_report (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
/* Means we are ONLY running locally */
/* we're clearly running a test, don't daemonize */
{
/* Means we are ONLY running locally */
/* we're clearly running a test, don't daemonize */
- proc = do_start_process (GNUNET_NO, pos->std_inheritance,
- NULL, loprefix, binary, "-c", config,
- /* no daemonization! */
- lopostfix, NULL);
+ if (NULL == config)
+ proc = do_start_process (GNUNET_NO, pos->std_inheritance,
+ NULL, loprefix, binary,
+ /* no daemonization! */
+ lopostfix, NULL);
+ else
+ proc = do_start_process (GNUNET_NO, pos->std_inheritance,
+ NULL, loprefix, binary, "-c", config,
+ /* no daemonization! */
+ lopostfix, NULL);
}
else
{
}
else
{
- proc = do_start_process (GNUNET_NO, pos->std_inheritance,
- NULL, loprefix, binary, "-c", config,
- "-d", lopostfix, NULL);
+ if (NULL == config)
+ proc = do_start_process (GNUNET_NO, pos->std_inheritance,
+ NULL, loprefix, binary,
+ "-d", lopostfix, NULL);
+ else
+ proc = do_start_process (GNUNET_NO, pos->std_inheritance,
+ NULL, loprefix, binary, "-c", config,
+ "-d", lopostfix, NULL);
}
GNUNET_free (binary);
}
GNUNET_free (binary);
- GNUNET_free (config);
+ GNUNET_free
_non_null
(config);
GNUNET_free (loprefix);
GNUNET_free (lopostfix);
GNUNET_free (loprefix);
GNUNET_free (lopostfix);
- if (
proc == NULL
)
-
{
-
if (pos->callback != NULL)
-
pos->callback (pos->cls, GNUNET_ARM_PROCESS_FAILURE);
-
GNUNET_free (pos);
-
return;
-
}
+ if (
NULL == proc
)
+ {
+ if (pos->callback != NULL)
+ pos->callback (pos->cls, GNUNET_ARM_PROCESS_FAILURE);
+ GNUNET_free (pos);
+ return;
+ }
if (pos->callback != NULL)
pos->callback (pos->cls, GNUNET_ARM_PROCESS_STARTING);
GNUNET_free (proc);
if (pos->callback != NULL)
pos->callback (pos->cls, GNUNET_ARM_PROCESS_STARTING);
GNUNET_free (proc);