diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2013-12-06 14:36:35 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2013-12-06 14:36:35 +0000 |
commit | b264be8a6c07161f96718f0c9e2914596f334fa9 (patch) | |
tree | 5c93f00c4cdb746cc4e52f19738d17d3c4a9ad3c /src/util/gnunet-uri.c | |
parent | e995d358e231da11ec79aead4c91c25fbd4b563e (diff) | |
download | gnunet-b264be8a6c07161f96718f0c9e2914596f334fa9.tar.gz gnunet-b264be8a6c07161f96718f0c9e2914596f334fa9.zip |
gnunet-uri return handler exit code
Diffstat (limited to 'src/util/gnunet-uri.c')
-rw-r--r-- | src/util/gnunet-uri.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/util/gnunet-uri.c b/src/util/gnunet-uri.c index 3465b5906..279c5a42e 100644 --- a/src/util/gnunet-uri.c +++ b/src/util/gnunet-uri.c | |||
@@ -26,11 +26,10 @@ | |||
26 | #include "platform.h" | 26 | #include "platform.h" |
27 | #include "gnunet_util_lib.h" | 27 | #include "gnunet_util_lib.h" |
28 | 28 | ||
29 | |||
30 | /** | 29 | /** |
31 | * Global return value. | 30 | * Handler exit code |
32 | */ | 31 | */ |
33 | static int ret = 1; | 32 | static long unsigned int exit_code = 1; |
34 | 33 | ||
35 | /** | 34 | /** |
36 | * Helper process we started. | 35 | * Helper process we started. |
@@ -54,14 +53,9 @@ static void | |||
54 | maint_child_death (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 53 | maint_child_death (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
55 | { | 54 | { |
56 | enum GNUNET_OS_ProcessStatusType type; | 55 | enum GNUNET_OS_ProcessStatusType type; |
57 | unsigned long code; | 56 | if ( (GNUNET_OK != |
58 | 57 | GNUNET_OS_process_status (p, &type, &exit_code)) || | |
59 | if ( (GNUNET_OK == | 58 | (type != GNUNET_OS_PROCESS_EXITED) ) |
60 | GNUNET_OS_process_status (p, &type, &code)) && | ||
61 | (type == GNUNET_OS_PROCESS_EXITED) && | ||
62 | (0 == code) ) | ||
63 | ret = 0; | ||
64 | else | ||
65 | GNUNET_break (0 == GNUNET_OS_process_kill (p, GNUNET_TERM_SIG)); | 59 | GNUNET_break (0 == GNUNET_OS_process_kill (p, GNUNET_TERM_SIG)); |
66 | GNUNET_OS_process_destroy (p); | 60 | GNUNET_OS_process_destroy (p); |
67 | } | 61 | } |
@@ -178,7 +172,7 @@ main (int argc, char *const *argv) | |||
178 | GNUNET_DISK_pipe_close (sigpipe); | 172 | GNUNET_DISK_pipe_close (sigpipe); |
179 | sigpipe = NULL; | 173 | sigpipe = NULL; |
180 | GNUNET_free ((void *) argv); | 174 | GNUNET_free ((void *) argv); |
181 | return (GNUNET_OK == ret) ? 0 : 1; | 175 | return ((GNUNET_OK == ret) && (0 == exit_code)) ? 0 : 1; |
182 | } | 176 | } |
183 | 177 | ||
184 | /* end of gnunet-uri.c */ | 178 | /* end of gnunet-uri.c */ |