aboutsummaryrefslogtreecommitdiff
path: root/src/util/common_logging.c
diff options
context:
space:
mode:
authorBertrand Marc <beberking@gmail.com>2012-06-06 20:47:48 +0200
committerBertrand Marc <beberking@gmail.com>2012-06-06 20:47:48 +0200
commit740b30688bd745a527f96f9116c19acb3480971a (patch)
tree2709a3f4dba11c174aa9e1ba3612e30c578e76a9 /src/util/common_logging.c
parent2b81464a43485fcc8ce079fafdee7b7a171835f4 (diff)
Imported Upstream version 0.9.3upstream/0.9.3
Diffstat (limited to 'src/util/common_logging.c')
-rw-r--r--src/util/common_logging.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/util/common_logging.c b/src/util/common_logging.c
index e19aa8c..2c0fd57 100644
--- a/src/util/common_logging.c
+++ b/src/util/common_logging.c
@@ -530,6 +530,8 @@ parse_all_definitions ()
gnunet_force_log_parsed = GNUNET_YES;
}
#endif
+
+
/**
* Setup logging.
*
@@ -569,30 +571,29 @@ GNUNET_log_setup (const char *comp, const char *loglevel, const char *logfile)
if (NULL == fn)
return GNUNET_SYSERR;
dirwarn = (GNUNET_OK != GNUNET_DISK_directory_create_for_file (fn));
- altlog_fd = OPEN (fn, O_APPEND |
#if WINDOWS
+ altlog_fd = OPEN (fn, O_APPEND |
O_BINARY |
-#endif
O_WRONLY | O_CREAT,
-#if WINDOWS
- _S_IREAD | _S_IWRITE
+ _S_IREAD | _S_IWRITE);
#else
- S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH
+ altlog_fd = OPEN (fn, O_APPEND |
+ O_WRONLY | O_CREAT,
+ S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
#endif
- );
if (altlog_fd != -1)
{
int dup_return;
if (GNUNET_stderr != NULL)
fclose (GNUNET_stderr);
dup_return = dup2 (altlog_fd, 2);
- close (altlog_fd);
+ (void) close (altlog_fd);
if (dup_return != -1)
{
altlog = fdopen (2, "ab");
if (altlog == NULL)
{
- close (2);
+ (void) close (2);
altlog_fd = -1;
}
}