From 70d491fd687a1d91993b786b41d2f4d415cd2a78 Mon Sep 17 00:00:00 2001 From: Sebastian Dransfeld Date: Fri, 21 Jun 2013 10:32:18 +0200 Subject: [PATCH] efreetd: log to file Since it is started as a service --- src/bin/efreet/efreetd.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/bin/efreet/efreetd.c b/src/bin/efreet/efreetd.c index d3f6d8c..b3b63d5 100644 --- a/src/bin/efreet/efreetd.c +++ b/src/bin/efreet/efreetd.c @@ -2,6 +2,7 @@ # include #endif +#include #include #include @@ -23,7 +24,19 @@ quit(void) int main(int argc, char *argv[]) { + char buf[PATH_MAX]; + char *path; + FILE *log; + if (!eina_init()) return 1; + + strcpy(buf, "/tmp/efreetd_XXXXXX"); + path = mktemp(buf); + if (!path) return 1; + chmod(path, 0700); + log = fopen(path, "wb"); + eina_log_print_cb_set(eina_log_print_cb_file, log); + efreetd_log_dom = eina_log_domain_register("efreetd", EFREETD_DEFAULT_LOG_COLOR); if (efreetd_log_dom < 0) { -- 2.7.4