aboutsummaryrefslogtreecommitdiffstats
path: root/pseudo_util.c
diff options
context:
space:
mode:
authorSeebs <seebs@seebs.net>2016-09-28 22:12:29 -0500
committerSeebs <seebs@seebs.net>2016-09-28 22:12:29 -0500
commit7a0632cad851826d804db0540d9a59773e6bf29c (patch)
tree7c554e3772b7e59ce56bf3228e640f0a4dceb9f0 /pseudo_util.c
parenteead8a505245a292c43f070c0e836cdfeb7bd7bd (diff)
downloadpseudo-7a0632cad851826d804db0540d9a59773e6bf29c.tar.gz
pseudo-7a0632cad851826d804db0540d9a59773e6bf29c.tar.bz2
pseudo-7a0632cad851826d804db0540d9a59773e6bf29c.zip
Use correct file descriptor
So it turns out that pseudo_logfile() was returning 0 or -1, and pseudo_debug_logfile() was expecting it to be the correct file descriptor to use. And it's basically a mystery that any of that ever worked. Signed-off-by: Seebs <seebs@seebs.net>
Diffstat (limited to 'pseudo_util.c')
-rw-r--r--pseudo_util.c3
1 files changed, 2 insertions, 1 deletions
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;
}