aboutsummaryrefslogtreecommitdiff
path: root/src/util/strings.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/strings.c')
-rw-r--r--src/util/strings.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/util/strings.c b/src/util/strings.c
index 70a1160dd..d9280a37d 100644
--- a/src/util/strings.c
+++ b/src/util/strings.c
@@ -197,7 +197,7 @@ struct ConversionTable
197 * @param input input string to parse 197 * @param input input string to parse
198 * @param table table with the conversion of unit names to numbers 198 * @param table table with the conversion of unit names to numbers
199 * @param output where to store the result 199 * @param output where to store the result
200 * @return GNUNET_OK on success, GNUNET_SYSERR on error 200 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
201 */ 201 */
202static int 202static int
203convert_with_table (const char *input, 203convert_with_table (const char *input,
@@ -255,7 +255,7 @@ convert_with_table (const char *input,
255 * 255 *
256 * @param fancy_size human readable string (i.e. 1 MB) 256 * @param fancy_size human readable string (i.e. 1 MB)
257 * @param size set to the size in bytes 257 * @param size set to the size in bytes
258 * @return GNUNET_OK on success, GNUNET_SYSERR on error 258 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
259 */ 259 */
260int 260int
261GNUNET_STRINGS_fancy_size_to_bytes (const char *fancy_size, 261GNUNET_STRINGS_fancy_size_to_bytes (const char *fancy_size,
@@ -345,6 +345,9 @@ GNUNET_STRINGS_fancy_time_to_absolute (const char *fancy_time,
345{ 345{
346 struct tm tv; 346 struct tm tv;
347 time_t t; 347 time_t t;
348#if HAVE_TM_GMTOFF
349 struct tm *tp;
350#endif
348 351
349 if (0 == strcasecmp ("end of time", fancy_time)) 352 if (0 == strcasecmp ("end of time", fancy_time))
350 { 353 {
@@ -365,7 +368,10 @@ GNUNET_STRINGS_fancy_time_to_absolute (const char *fancy_time,
365 return GNUNET_SYSERR; 368 return GNUNET_SYSERR;
366 t = mktime (&tv); 369 t = mktime (&tv);
367 atime->abs_value_us = (uint64_t) ((uint64_t) t * 1000LL * 1000LL); 370 atime->abs_value_us = (uint64_t) ((uint64_t) t * 1000LL * 1000LL);
368#if LINUX 371#if HAVE_TM_GMTOFF
372 tp = localtime (&t);
373 atime->abs_value_us += 1000LL * 1000LL * tp->tm_gmtoff;
374#elif defined LINUX
369 atime->abs_value_us -= 1000LL * 1000LL * timezone; 375 atime->abs_value_us -= 1000LL * 1000LL * timezone;
370#elif defined WINDOWS 376#elif defined WINDOWS
371 { 377 {