aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog.txt3
-rw-r--r--pseudo_util.c3
2 files changed, 5 insertions, 1 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt
index 1ae6abd..65b9759 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -2,6 +2,9 @@
* (seebs) Send errors to log when daemonizing, but do that a lot
sooner to prevent startup messages which can show up spuriously
with multiple clients.
+ * (seebs) return file descriptor from pseudo_logfile, so we set
+ pseudo_util_debug_fd to the right value instead of to stdin.
+ Nice bug.
2016-09-22:
* (seebs) don't send SIGUSR1 to init.
diff --git a/pseudo_util.c b/pseudo_util.c
index 0c156cf..a60c74b 100644
--- a/pseudo_util.c
+++ b/pseudo_util.c
@@ -1569,7 +1569,7 @@ pseudo_logfile(char *filename, char *defname, int prefer_fd) {
if (fd == -1)
return -1;
else
- return 0;
+ return fd;
}
int
@@ -1579,6 +1579,7 @@ pseudo_debug_logfile(char *defname, int prefer_fd) {
fd = pseudo_logfile(filename, defname, prefer_fd);
if (fd > -1) {
+ pseudo_diag("debug_logfile: fd %d\n", fd);
pseudo_util_debug_fd = fd;
return 0;
}