diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-08-11 21:21:56 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-08-11 21:21:56 +0000 |
commit | 3d7fefedc9ba60bd8e8448efe8b628446d958536 (patch) | |
tree | 61ce41a52cd6e7232cead77818ef265993b2427e /src/arm | |
parent | 4a0398474db197abed243a123fb971fbeeffab4b (diff) | |
download | gnunet-3d7fefedc9ba60bd8e8448efe8b628446d958536.tar.gz gnunet-3d7fefedc9ba60bd8e8448efe8b628446d958536.zip |
changing time measurement from milliseconds to microseconds
Diffstat (limited to 'src/arm')
-rw-r--r-- | src/arm/gnunet-arm.c | 10 | ||||
-rw-r--r-- | src/arm/gnunet-service-arm.c | 9 | ||||
-rw-r--r-- | src/arm/test_exponential_backoff.c | 4 |
3 files changed, 11 insertions, 12 deletions
diff --git a/src/arm/gnunet-arm.c b/src/arm/gnunet-arm.c index 4a68a97ea..85cb1f45d 100644 --- a/src/arm/gnunet-arm.c +++ b/src/arm/gnunet-arm.c | |||
@@ -547,7 +547,7 @@ action_loop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
547 | { | 547 | { |
548 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Termination action\n"); | 548 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Termination action\n"); |
549 | GNUNET_ARM_request_service_stop (h, term, | 549 | GNUNET_ARM_request_service_stop (h, term, |
550 | (0 == timeout.rel_value) ? STOP_TIMEOUT : timeout, | 550 | (0 == timeout.rel_value_us) ? STOP_TIMEOUT : timeout, |
551 | &term_callback, NULL); | 551 | &term_callback, NULL); |
552 | return; | 552 | return; |
553 | } | 553 | } |
@@ -557,7 +557,7 @@ action_loop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
557 | { | 557 | { |
558 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "End action\n"); | 558 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "End action\n"); |
559 | GNUNET_ARM_request_service_stop (h, "arm", | 559 | GNUNET_ARM_request_service_stop (h, "arm", |
560 | (0 == timeout.rel_value) ? STOP_TIMEOUT_ARM : timeout, | 560 | (0 == timeout.rel_value_us) ? STOP_TIMEOUT_ARM : timeout, |
561 | &stop_callback, NULL); | 561 | &stop_callback, NULL); |
562 | return; | 562 | return; |
563 | } | 563 | } |
@@ -569,7 +569,7 @@ action_loop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
569 | GNUNET_ARM_request_service_start (h, "arm", | 569 | GNUNET_ARM_request_service_start (h, "arm", |
570 | (no_stdout ? 0 : GNUNET_OS_INHERIT_STD_OUT) | | 570 | (no_stdout ? 0 : GNUNET_OS_INHERIT_STD_OUT) | |
571 | (no_stderr ? 0 : GNUNET_OS_INHERIT_STD_ERR), | 571 | (no_stderr ? 0 : GNUNET_OS_INHERIT_STD_ERR), |
572 | (0 == timeout.rel_value) ? START_TIMEOUT: timeout, | 572 | (0 == timeout.rel_value_us) ? START_TIMEOUT: timeout, |
573 | start_callback, NULL); | 573 | start_callback, NULL); |
574 | return; | 574 | return; |
575 | } | 575 | } |
@@ -579,7 +579,7 @@ action_loop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
579 | { | 579 | { |
580 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Initialization action\n"); | 580 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Initialization action\n"); |
581 | GNUNET_ARM_request_service_start (h, init, GNUNET_OS_INHERIT_STD_NONE, | 581 | GNUNET_ARM_request_service_start (h, init, GNUNET_OS_INHERIT_STD_NONE, |
582 | (0 == timeout.rel_value) ? STOP_TIMEOUT : timeout, | 582 | (0 == timeout.rel_value_us) ? STOP_TIMEOUT : timeout, |
583 | &init_callback, NULL); | 583 | &init_callback, NULL); |
584 | return; | 584 | return; |
585 | } | 585 | } |
@@ -590,7 +590,7 @@ action_loop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
590 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 590 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
591 | "Going to list all running services controlled by ARM.\n"); | 591 | "Going to list all running services controlled by ARM.\n"); |
592 | GNUNET_ARM_request_service_list (h, | 592 | GNUNET_ARM_request_service_list (h, |
593 | (0 == timeout.rel_value) ? LIST_TIMEOUT : timeout, | 593 | (0 == timeout.rel_value_us) ? LIST_TIMEOUT : timeout, |
594 | &list_callback, &list); | 594 | &list_callback, &list); |
595 | return; | 595 | return; |
596 | } | 596 | } |
diff --git a/src/arm/gnunet-service-arm.c b/src/arm/gnunet-service-arm.c index 1acb82f72..f5426e176 100644 --- a/src/arm/gnunet-service-arm.c +++ b/src/arm/gnunet-service-arm.c | |||
@@ -1012,8 +1012,7 @@ delayed_restart_task (void *cls, | |||
1012 | if (NULL != sl->proc) | 1012 | if (NULL != sl->proc) |
1013 | continue; | 1013 | continue; |
1014 | /* service is currently not running */ | 1014 | /* service is currently not running */ |
1015 | if (GNUNET_TIME_absolute_get_remaining (sl->restart_at).rel_value == | 1015 | if (0 == GNUNET_TIME_absolute_get_remaining (sl->restart_at).rel_value_us) |
1016 | 0) | ||
1017 | { | 1016 | { |
1018 | /* restart is now allowed */ | 1017 | /* restart is now allowed */ |
1019 | if (sl->is_default) | 1018 | if (sl->is_default) |
@@ -1046,7 +1045,7 @@ delayed_restart_task (void *cls, | |||
1046 | (sl->restart_at)); | 1045 | (sl->restart_at)); |
1047 | } | 1046 | } |
1048 | } | 1047 | } |
1049 | if (lowestRestartDelay.rel_value != GNUNET_TIME_UNIT_FOREVER_REL.rel_value) | 1048 | if (lowestRestartDelay.rel_value_us != GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us) |
1050 | { | 1049 | { |
1051 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1050 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1052 | "Will restart process in %s\n", | 1051 | "Will restart process in %s\n", |
@@ -1126,7 +1125,7 @@ maint_child_death (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1126 | statstr = _( /* process termination method */ "unknown"); | 1125 | statstr = _( /* process termination method */ "unknown"); |
1127 | statcode = 0; | 1126 | statcode = 0; |
1128 | } | 1127 | } |
1129 | if (0 != pos->killed_at.abs_value) | 1128 | if (0 != pos->killed_at.abs_value_us) |
1130 | { | 1129 | { |
1131 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 1130 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
1132 | _("Service `%s' took %s to terminate\n"), | 1131 | _("Service `%s' took %s to terminate\n"), |
@@ -1149,7 +1148,7 @@ maint_child_death (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1149 | if ((statusType == GNUNET_OS_PROCESS_EXITED) && (statcode == 0)) | 1148 | if ((statusType == GNUNET_OS_PROCESS_EXITED) && (statcode == 0)) |
1150 | { | 1149 | { |
1151 | /* process terminated normally, allow restart at any time */ | 1150 | /* process terminated normally, allow restart at any time */ |
1152 | pos->restart_at.abs_value = 0; | 1151 | pos->restart_at.abs_value_us = 0; |
1153 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 1152 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
1154 | _("Service `%s' terminated normally, will restart at any time\n"), | 1153 | _("Service `%s' terminated normally, will restart at any time\n"), |
1155 | pos->name); | 1154 | pos->name); |
diff --git a/src/arm/test_exponential_backoff.c b/src/arm/test_exponential_backoff.c index c61bc2eec..7d8d771a2 100644 --- a/src/arm/test_exponential_backoff.c +++ b/src/arm/test_exponential_backoff.c | |||
@@ -250,7 +250,7 @@ kill_task (void *cbData, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
250 | } | 250 | } |
251 | else | 251 | else |
252 | { | 252 | { |
253 | waitedFor.rel_value = 0; | 253 | waitedFor.rel_value_us = 0; |
254 | } | 254 | } |
255 | /* Connect to the doNothing task */ | 255 | /* Connect to the doNothing task */ |
256 | doNothingConnection = GNUNET_CLIENT_connect ("do-nothing", cfg); | 256 | doNothingConnection = GNUNET_CLIENT_connect ("do-nothing", cfg); |
@@ -261,7 +261,7 @@ kill_task (void *cbData, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
261 | { | 261 | { |
262 | GNUNET_CLIENT_disconnect (doNothingConnection); | 262 | GNUNET_CLIENT_disconnect (doNothingConnection); |
263 | GNUNET_ARM_request_service_stop (arm, "do-nothing", TIMEOUT, NULL, NULL); | 263 | GNUNET_ARM_request_service_stop (arm, "do-nothing", TIMEOUT, NULL, NULL); |
264 | if (waitedFor_prev.rel_value >= waitedFor.rel_value) | 264 | if (waitedFor_prev.rel_value_us >= waitedFor.rel_value_us) |
265 | ok = 9; | 265 | ok = 9; |
266 | else | 266 | else |
267 | ok = 0; | 267 | ok = 0; |