From c0f0a7a97bb2d3ab217b9753351431509ea40840 Mon Sep 17 00:00:00 2001 From: Till Kamppeter Date: Fri, 10 Feb 2012 21:12:59 +0100 Subject: Imported Upstream version 4.0.10 --- foomaticrip.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'foomaticrip.c') diff --git a/foomaticrip.c b/foomaticrip.c index e9ae0f7..7d7d9ae 100644 --- a/foomaticrip.c +++ b/foomaticrip.c @@ -1188,9 +1188,13 @@ int main(int argc, char** argv) if (arglist_remove_flag(arglist, "--debug")) debug = 1; - if (debug) - logh = fopen(LOG_FILE ".log", "w"); /* insecure, use for debugging only */ - else if (quiet && !verbose) + if (debug) { + int fd = mkstemp (LOG_FILE "-XXXXXX.log"); + if (fd != -1) + logh = fdopen(fd, "w"); + else + logh = stderr; + } else if (quiet && !verbose) logh = NULL; /* Quiet mode, do not log */ else logh = stderr; /* Default: log to stderr */ @@ -1634,11 +1638,6 @@ int main(int argc, char** argv) /* TODO tbd */ } - /* In debug mode save the data supposed to be fed into the - renderer also into a file, reset the file here */ - if (debug) - run_system_process("reset-file", "> " LOG_FILE ".ps"); - filename = strtok_r(filelist->data, " ", &p); while (filename) { _log("\n================================================\n\n" -- cgit v1.2.3