aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/util/configuration.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/util/configuration.c b/src/util/configuration.c
index 4aa5fed5a..978765970 100644
--- a/src/util/configuration.c
+++ b/src/util/configuration.c
@@ -690,13 +690,22 @@ GNUNET_CONFIGURATION_get_value_time (const struct GNUNET_CONFIGURATION_Handle
690 const char *option, 690 const char *option,
691 struct GNUNET_TIME_Relative *time) 691 struct GNUNET_TIME_Relative *time)
692{ 692{
693 struct ConfigEntry *e;
693 unsigned long long num; 694 unsigned long long num;
694 int ret;
695 695
696 ret = GNUNET_CONFIGURATION_get_value_number (cfg, section, option, &num); 696 e = findEntry (cfg, section, option);
697 if (ret == GNUNET_OK) 697 if (e == NULL)
698 time->rel_value = (uint64_t) num; 698 return GNUNET_SYSERR;
699 return ret; 699 if ( (0 == strcasecmp (e->val, "infinity")) ||
700 (0 == strcasecmp (e->val, "forever")) )
701 {
702 *time = GNUNET_TIME_UNIT_FOREVER_REL;
703 return GNUNET_OK;
704 }
705 if (1 != SSCANF (e->val, "%llu", &num))
706 return GNUNET_SYSERR;
707 time->rel_value = (uint64_t) num;
708 return GNUNET_OK;
700} 709}
701 710
702 711