diff options
Diffstat (limited to 'libddekit')
-rw-r--r-- | libddekit/printf.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/libddekit/printf.c b/libddekit/printf.c index 72ff5003..1996987f 100644 --- a/libddekit/printf.c +++ b/libddekit/printf.c @@ -71,10 +71,16 @@ int ddekit_vprintf(const char *fmt, va_list va) int log_init () { - char *log_file_name = mktemp ("/tmp/dde_log.XXXXXX"); - output = fopen (log_file_name, "a+"); + char template[] = "/var/log/dde_log.XXXXXX"; + int ret = mkstemp (template); + if (ret < 0) { + error (0, errno, "mkstemp"); + return -1; + } + + output = fopen (template, "a+"); if (!output) { - error (0, errno, "open %s", log_file_name); + error (0, errno, "open %s", template); return -1; } return 0; |