projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Drop libevent and use our own event handling again.
[tinc]
/
src
/
logger.c
diff --git
a/src/logger.c
b/src/logger.c
index
4527a37
..
6e3d2c0
100644
(file)
--- a/
src/logger.c
+++ b/
src/logger.c
@@
-41,7
+41,6
@@
bool logcontrol = false;
static void real_logger(int level, int priority, const char *message) {
char timestr[32] = "";
static void real_logger(int level, int priority, const char *message) {
char timestr[32] = "";
- time_t now;
static bool suppress = false;
// Bail out early if there is nothing to do.
static bool suppress = false;
// Bail out early if there is nothing to do.
@@
-58,8
+57,9
@@
static void real_logger(int level, int priority, const char *message) {
fflush(stderr);
break;
case LOGMODE_FILE:
fflush(stderr);
break;
case LOGMODE_FILE:
- now = time(NULL);
- strftime(timestr, sizeof timestr, "%Y-%m-%d %H:%M:%S", localtime(&now));
+ if(!now.tv_sec)
+ gettimeofday(&now, NULL);
+ strftime(timestr, sizeof timestr, "%Y-%m-%d %H:%M:%S", localtime(&now.tv_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;