projects
/
psensor-pkg-ubuntu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Imported Upstream version 1.0.2
[psensor-pkg-ubuntu.git]
/
src
/
lib
/
slog.c
diff --git
a/src/lib/slog.c
b/src/lib/slog.c
index
cb2b124
..
99eb536
100644
(file)
--- a/
src/lib/slog.c
+++ b/
src/lib/slog.c
@@
-33,7
+33,7
@@
#include "bool.h"
#include "config.h"
#include "bool.h"
#include "config.h"
-#include
"log.h"
+#include
<plog.h>
#include "ptime.h"
#include "slog.h"
#include "ptime.h"
#include "slog.h"
@@
-47,6
+47,24
@@
static time_t st;
static const char *DEFAULT_FILENAME = "sensors.log";
static const char *DEFAULT_FILENAME = "sensors.log";
+static char *time_to_str(time_t *t)
+{
+ struct tm lt;
+ char *str;
+
+ if (!localtime_r(t, <))
+ return NULL;
+
+ str = malloc(64);
+
+ if (strftime(str, 64, "%s", <)) {
+ return str;
+ } else {
+ free(str);
+ return NULL;
+ }
+}
+
static char *get_default_path()
{
char *home, *path, *dir;
static char *get_default_path()
{
char *home, *path, *dir;