diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-06-17 21:12:09 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-06-17 21:12:09 +0000 |
commit | bed39036b47e1b820ee40d645f743e18520c4f8c (patch) | |
tree | 6218facf7c12448327e82780896a609ac000e128 /src/util/common_logging.c | |
parent | a6d3a7a355634ef0396f009f9286962cdc4c6077 (diff) | |
download | gnunet-bed39036b47e1b820ee40d645f743e18520c4f8c.tar.gz gnunet-bed39036b47e1b820ee40d645f743e18520c4f8c.zip |
fixes
Diffstat (limited to 'src/util/common_logging.c')
-rw-r--r-- | src/util/common_logging.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/util/common_logging.c b/src/util/common_logging.c index 79e31246a..003696a48 100644 --- a/src/util/common_logging.c +++ b/src/util/common_logging.c | |||
@@ -180,6 +180,8 @@ GNUNET_log_setup (const char *comp, const char *loglevel, const char *logfile) | |||
180 | if (logfile == NULL) | 180 | if (logfile == NULL) |
181 | return GNUNET_OK; | 181 | return GNUNET_OK; |
182 | fn = GNUNET_STRINGS_filename_expand (logfile); | 182 | fn = GNUNET_STRINGS_filename_expand (logfile); |
183 | if (NULL == fn) | ||
184 | return GNUNET_SYSERR; | ||
183 | dirwarn = (GNUNET_OK != GNUNET_DISK_directory_create_for_file (fn)); | 185 | dirwarn = (GNUNET_OK != GNUNET_DISK_directory_create_for_file (fn)); |
184 | altlog = FOPEN (fn, "a"); | 186 | altlog = FOPEN (fn, "a"); |
185 | if (altlog == NULL) | 187 | if (altlog == NULL) |
@@ -374,7 +376,10 @@ mylog (enum GNUNET_ErrorType kind, | |||
374 | time (&timetmp); | 376 | time (&timetmp); |
375 | memset (date, 0, DATE_STR_SIZE); | 377 | memset (date, 0, DATE_STR_SIZE); |
376 | tmptr = localtime (&timetmp); | 378 | tmptr = localtime (&timetmp); |
377 | strftime (date, DATE_STR_SIZE, "%b %d %H:%M:%S", tmptr); | 379 | if (NULL != tmptr) |
380 | strftime (date, DATE_STR_SIZE, "%b %d %H:%M:%S", tmptr); | ||
381 | else | ||
382 | strcpy (date, "localtime error"); | ||
378 | if ((0 != (kind & GNUNET_ERROR_TYPE_BULK)) && | 383 | if ((0 != (kind & GNUNET_ERROR_TYPE_BULK)) && |
379 | (last_bulk_time.value != 0) && | 384 | (last_bulk_time.value != 0) && |
380 | (0 == strncmp (buf, last_bulk, sizeof (last_bulk)))) | 385 | (0 == strncmp (buf, last_bulk, sizeof (last_bulk)))) |