aboutsummaryrefslogtreecommitdiffstats
path: root/jnlib/logging.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2004-04-30 03:58:21 +0000
committerWerner Koch <[email protected]>2004-04-30 03:58:21 +0000
commit623fad67a576532a82c065e98b955da43266dcf4 (patch)
tree258194bab553543438ba52c5c46febce1c2dfe5a /jnlib/logging.c
parent(check_and_store): Do not update the stats for hidden (diff)
downloadgnupg-623fad67a576532a82c065e98b955da43266dcf4.tar.gz
gnupg-623fad67a576532a82c065e98b955da43266dcf4.zip
* gpg-agent.c (parse_rereadable_options): New arg REREAD. Allow
changing oLogFile. (current_logfile): New. * logging.c (log_set_file): Make sure the log stream will be closed even if the stderr fileno will be assigned to a new socket.
Diffstat (limited to 'jnlib/logging.c')
-rw-r--r--jnlib/logging.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/jnlib/logging.c b/jnlib/logging.c
index fdf2d7fcb..7397ddd30 100644
--- a/jnlib/logging.c
+++ b/jnlib/logging.c
@@ -211,7 +211,7 @@ fun_closer (void *cookie_arg)
-/* Set the file to write log to. The sepcial names NULL and "_" may
+/* Set the file to write log to. The special names NULL and "-" may
be used to select stderr and names formatted like
"socket:///home/foo/mylogs" may be used to write the logging to the
socket "/home/foo/mylogs". If the connection to the socket fails
@@ -258,6 +258,13 @@ log_set_file (const char *name)
/* We always need to print the prefix and the pid, so that the
server reading the socket can do something meanigful. */
force_prefixes = 1;
+ /* On success close the old logstream right now, so that we are
+ really sure it has been closed. */
+ if (fp)
+ {
+ fclose (logstream);
+ logstream = NULL;
+ }
}
else
fp = (name && strcmp(name,"-"))? fopen (name, "a") : stderr;