summaryrefslogtreecommitdiff
path: root/src/bin/efreet
diff options
context:
space:
mode:
authorSebastian Dransfeld <sebastian.dransfeld@sintef.no>2013-06-21 10:32:18 +0200
committerSebastian Dransfeld <sebastian.dransfeld@sintef.no>2013-06-21 10:32:18 +0200
commit70d491fd687a1d91993b786b41d2f4d415cd2a78 (patch)
treea093920ad8c4f839116a33b3787a30fb05be4781 /src/bin/efreet
parentebcd97cc938851352642eb42e3c5bc43ee288631 (diff)
efreetd: log to file
Since it is started as a service
Diffstat (limited to 'src/bin/efreet')
-rw-r--r--src/bin/efreet/efreetd.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/bin/efreet/efreetd.c b/src/bin/efreet/efreetd.c
index d3f6d8cfac..b3b63d5b32 100644
--- a/src/bin/efreet/efreetd.c
+++ b/src/bin/efreet/efreetd.c
@@ -2,6 +2,7 @@
2# include <config.h> 2# include <config.h>
3#endif 3#endif
4 4
5#include <stdlib.h>
5#include <sys/time.h> 6#include <sys/time.h>
6#include <sys/resource.h> 7#include <sys/resource.h>
7 8
@@ -23,7 +24,19 @@ quit(void)
23int 24int
24main(int argc, char *argv[]) 25main(int argc, char *argv[])
25{ 26{
27 char buf[PATH_MAX];
28 char *path;
29 FILE *log;
30
26 if (!eina_init()) return 1; 31 if (!eina_init()) return 1;
32
33 strcpy(buf, "/tmp/efreetd_XXXXXX");
34 path = mktemp(buf);
35 if (!path) return 1;
36 chmod(path, 0700);
37 log = fopen(path, "wb");
38 eina_log_print_cb_set(eina_log_print_cb_file, log);
39
27 efreetd_log_dom = eina_log_domain_register("efreetd", EFREETD_DEFAULT_LOG_COLOR); 40 efreetd_log_dom = eina_log_domain_register("efreetd", EFREETD_DEFAULT_LOG_COLOR);
28 if (efreetd_log_dom < 0) 41 if (efreetd_log_dom < 0)
29 { 42 {