From: Martin Mares Date: Thu, 12 Feb 2015 18:06:34 +0000 (+0100) Subject: Logging: log_new_fd to fd=2 also prevents stderr from closing X-Git-Tag: v6.3~8 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=52ec3fbba752c314e7a6b1d64bb16bb0a0d47600;p=libucw.git Logging: log_new_fd to fd=2 also prevents stderr from closing --- diff --git a/ucw/log-file.c b/ucw/log-file.c index 40871418..2e7a8d26 100644 --- a/ucw/log-file.c +++ b/ucw/log-file.c @@ -119,6 +119,8 @@ log_new_fd(int fd, uint flags) struct log_stream *ls = log_new_stream(sizeof(struct file_stream)); struct file_stream *fs = (struct file_stream *) ls; fs->fd = fd; + if (fd == 2) + log_stderr_replaced = 1; fs->flags = flags; ls->msgfmt = LSFMT_DEFAULT; ls->handler = file_handler;