diff options
author | Sebastian Dransfeld <sebastian.dransfeld@sintef.no> | 2013-06-21 10:32:18 +0200 |
---|---|---|
committer | Sebastian Dransfeld <sebastian.dransfeld@sintef.no> | 2013-06-21 10:32:18 +0200 |
commit | 70d491fd687a1d91993b786b41d2f4d415cd2a78 (patch) | |
tree | a093920ad8c4f839116a33b3787a30fb05be4781 /src | |
parent | ebcd97cc938851352642eb42e3c5bc43ee288631 (diff) | |
download | efl-70d491fd687a1d91993b786b41d2f4d415cd2a78.tar.gz |
efreetd: log to file
Since it is started as a service
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/efreet/efreetd.c | 13 |
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 @@ # include <config.h> #endif +#include <stdlib.h> #include <sys/time.h> #include <sys/resource.h> @@ -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) { |