X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Futil%2Ftime.c;h=01a3cddd5adac5e316b9c0ac7cfea6d068b6f101;hb=34f34474b6137233d6700d4599f42257e8208af2;hp=fea0947bd2b80ff75bacb35c517a6efae984ce48;hpb=834c2cf9268d7738b314bfb1e0f11484500d4dbd;p=oweals%2Fgnunet.git diff --git a/src/util/time.c b/src/util/time.c index fea0947bd..01a3cddd5 100644 --- a/src/util/time.c +++ b/src/util/time.c @@ -1,6 +1,6 @@ /* This file is part of GNUnet. - (C) 2001-2013 Christian Grothoff (and other contributing authors) + Copyright (C) 2001-2013 Christian Grothoff (and other contributing authors) GNUnet is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published @@ -24,7 +24,7 @@ * @brief functions for handling time and time arithmetic */ #include "platform.h" -#include "gnunet_time_lib.h" +#include "gnunet_util_lib.h" #define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__) @@ -50,7 +50,7 @@ GNUNET_TIME_set_offset (long long offset) * * @return the offset we currently skew the locale time by */ -long long +long long GNUNET_TIME_get_offset () { return timestamp_offset; @@ -385,6 +385,8 @@ GNUNET_TIME_relative_multiply (struct GNUNET_TIME_Relative rel, if (0 == factor) return GNUNET_TIME_UNIT_ZERO; + if (rel.rel_value_us == GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us) + return GNUNET_TIME_UNIT_FOREVER_REL; ret.rel_value_us = rel.rel_value_us * (unsigned long long) factor; if (ret.rel_value_us / factor != rel.rel_value_us) { @@ -579,10 +581,10 @@ GNUNET_TIME_get_current_year () /** * Convert an expiration time to the respective year (rounds) * - * @param at absolute time + * @param at absolute time * @return year a year (after 1970), 0 on error */ -unsigned int +unsigned int GNUNET_TIME_time_to_year (struct GNUNET_TIME_Absolute at) { struct tm *t;