projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove unused device stats variables.
[tinc]
/
src
/
logger.c
diff --git
a/src/logger.c
b/src/logger.c
index
6e3d2c0
..
2b4c7e3
100644
(file)
--- a/
src/logger.c
+++ b/
src/logger.c
@@
-1,6
+1,6
@@
/*
logger.c -- logging code
/*
logger.c -- logging code
- Copyright (C) 2004-201
2
Guus Sliepen <guus@tinc-vpn.org>
+ Copyright (C) 2004-201
3
Guus Sliepen <guus@tinc-vpn.org>
2004-2005 Ivo Timmermans
This program is free software; you can redistribute it and/or modify
2004-2005 Ivo Timmermans
This program is free software; you can redistribute it and/or modify
@@
-22,6
+22,7
@@
#include "conf.h"
#include "meta.h"
#include "conf.h"
#include "meta.h"
+#include "names.h"
#include "logger.h"
#include "connection.h"
#include "control_common.h"
#include "logger.h"
#include "connection.h"
#include "control_common.h"
@@
-30,7
+31,6
@@
debug_t debug_level = DEBUG_NOTHING;
static logmode_t logmode = LOGMODE_STDERR;
static pid_t logpid;
debug_t debug_level = DEBUG_NOTHING;
static logmode_t logmode = LOGMODE_STDERR;
static pid_t logpid;
-extern char *logfilename;
static FILE *logfile = NULL;
#ifdef HAVE_MINGW
static HANDLE loghandle = NULL;
static FILE *logfile = NULL;
#ifdef HAVE_MINGW
static HANDLE loghandle = NULL;
@@
-59,7
+59,8
@@
static void real_logger(int level, int priority, const char *message) {
case LOGMODE_FILE:
if(!now.tv_sec)
gettimeofday(&now, NULL);
case LOGMODE_FILE:
if(!now.tv_sec)
gettimeofday(&now, NULL);
- strftime(timestr, sizeof timestr, "%Y-%m-%d %H:%M:%S", localtime(&now.tv_sec));
+ time_t now_sec = now.tv_sec;
+ strftime(timestr, sizeof timestr, "%Y-%m-%d %H:%M:%S", localtime(&now_sec));
fprintf(logfile, "%s %s[%ld]: %s\n", timestr, logident, (long)logpid, message);
fflush(logfile);
break;
fprintf(logfile, "%s %s[%ld]: %s\n", timestr, logident, (long)logpid, message);
fflush(logfile);
break;