projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
configure.ac: Improve detection and usage of pthread_set_name_np(3).
[collectd.git]
/
src
/
logfile.c
diff --git
a/src/logfile.c
b/src/logfile.c
index
b75ecb8
..
6d55584
100644
(file)
--- a/
src/logfile.c
+++ b/
src/logfile.c
@@
-27,11
+27,10
@@
**/
#include "collectd.h"
**/
#include "collectd.h"
+
#include "common.h"
#include "plugin.h"
#include "common.h"
#include "plugin.h"
-#include <pthread.h>
-
#define DEFAULT_LOGFILE LOCALSTATEDIR"/log/collectd.log"
#if COLLECT_DEBUG
#define DEFAULT_LOGFILE LOCALSTATEDIR"/log/collectd.log"
#if COLLECT_DEBUG
@@
-91,7
+90,6
@@
static void logfile_print (const char *msg, int severity,
{
FILE *fh;
_Bool do_close = 0;
{
FILE *fh;
_Bool do_close = 0;
- struct tm timestamp_tm;
char timestamp_str[64];
char level_str[16] = "";
char timestamp_str[64];
char level_str[16] = "";
@@
-121,8
+119,8
@@
static void logfile_print (const char *msg, int severity,
if (print_timestamp)
{
if (print_timestamp)
{
-
time_t tt = CDTIME_T_TO_TIME_T (timestamp_time)
;
- localtime_r (&
tt
, ×tamp_tm);
+
struct tm timestamp_tm
;
+ localtime_r (&
CDTIME_T_TO_TIME_T (timestamp_time)
, ×tamp_tm);
strftime (timestamp_str, sizeof (timestamp_str), "%Y-%m-%d %H:%M:%S",
×tamp_tm);
strftime (timestamp_str, sizeof (timestamp_str), "%Y-%m-%d %H:%M:%S",
×tamp_tm);
@@
-201,7
+199,7
@@
static int logfile_notification (const notification_t *n,
#define APPEND(bufptr, buflen, key, value) \
if ((buflen > 0) && (strlen (value) > 0)) { \
#define APPEND(bufptr, buflen, key, value) \
if ((buflen > 0) && (strlen (value) > 0)) { \
-
int
status = ssnprintf (bufptr, buflen, ", %s = %s", key, value); \
+ status = ssnprintf (bufptr, buflen, ", %s = %s", key, value); \
if (status > 0) { \
bufptr += status; \
buflen -= status; \
if (status > 0) { \
bufptr += status; \
buflen -= status; \