aboutsummaryrefslogtreecommitdiff
path: root/src/util/common_logging.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/common_logging.c')
-rw-r--r--src/util/common_logging.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/util/common_logging.c b/src/util/common_logging.c
index 695b49913..492d00dc6 100644
--- a/src/util/common_logging.c
+++ b/src/util/common_logging.c
@@ -24,7 +24,8 @@
24 * @author Christian Grothoff 24 * @author Christian Grothoff
25 */ 25 */
26#include "platform.h" 26#include "platform.h"
27#include "gnunet_util_lib.h" 27#include "gnunet_crypto_lib.h"
28#include "gnunet_strings_lib.h"
28#include <regex.h> 29#include <regex.h>
29 30
30 31
@@ -328,7 +329,6 @@ setup_log_file (const struct tm *tm)
328{ 329{
329 static char last_fn[PATH_MAX + 1]; 330 static char last_fn[PATH_MAX + 1];
330 char fn[PATH_MAX + 1]; 331 char fn[PATH_MAX + 1];
331 int dirwarn;
332 int altlog_fd; 332 int altlog_fd;
333 int dup_return; 333 int dup_return;
334 FILE *altlog; 334 FILE *altlog;
@@ -352,7 +352,6 @@ setup_log_file (const struct tm *tm)
352 return GNUNET_OK; /* no change */ 352 return GNUNET_OK; /* no change */
353 log_rotate (last_fn); 353 log_rotate (last_fn);
354 strcpy (last_fn, fn); 354 strcpy (last_fn, fn);
355 dirwarn = (GNUNET_OK != GNUNET_DISK_directory_create_for_file (fn));
356#if WINDOWS 355#if WINDOWS
357 altlog_fd = OPEN (fn, O_APPEND | 356 altlog_fd = OPEN (fn, O_APPEND |
358 O_BINARY | 357 O_BINARY |
@@ -386,16 +385,13 @@ setup_log_file (const struct tm *tm)
386 if (-1 == altlog_fd) 385 if (-1 == altlog_fd)
387 { 386 {
388 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "open", fn); 387 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "open", fn);
389 if (dirwarn)
390 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
391 _("Failed to create or access directory for log file `%s'\n"),
392 fn);
393 return GNUNET_SYSERR; 388 return GNUNET_SYSERR;
394 } 389 }
395 GNUNET_stderr = altlog; 390 GNUNET_stderr = altlog;
396 return GNUNET_OK; 391 return GNUNET_OK;
397} 392}
398 393
394
399/** 395/**
400 * Utility function - adds a parsed definition to logdefs array. 396 * Utility function - adds a parsed definition to logdefs array.
401 * 397 *