projects
/
oweals
/
gnunet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Don't shadow the system() function
[oweals/gnunet.git]
/
src
/
util
/
time.c
diff --git
a/src/util/time.c
b/src/util/time.c
index fea0947bd2b80ff75bacb35c517a6efae984ce48..01a3cddd5adac5e316b9c0ac7cfea6d068b6f101 100644
(file)
--- a/
src/util/time.c
+++ b/
src/util/time.c
@@
-1,6
+1,6
@@
/*
This file is part of GNUnet.
/*
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
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"
* @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__)
#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
*/
*
* @return the offset we currently skew the locale time by
*/
-long long
+long long
GNUNET_TIME_get_offset ()
{
return timestamp_offset;
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 (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)
{
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)
*
/**
* 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
*/
* @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;
GNUNET_TIME_time_to_year (struct GNUNET_TIME_Absolute at)
{
struct tm *t;