aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/syslogd/syslogd.c
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>1996-12-10 17:52:23 +0000
committerPeter Wemm <peter@FreeBSD.org>1996-12-10 17:52:23 +0000
commit5bb4699e9cf4bb797b88b6402a2216119508721b (patch)
tree625a822047ff7c2d95f97b18fcff6d669bb757b9 /usr.sbin/syslogd/syslogd.c
parent13629194a527676feec1c43dd461b18854445645 (diff)
downloadsrc-5bb4699e9cf4bb797b88b6402a2216119508721b.tar.gz
src-5bb4699e9cf4bb797b88b6402a2216119508721b.zip
Revert part of the previous change. syslogd (when logging to ttys)
has always held an open file descriptor. This allowed logging to spare virtual consoles and being able to switch to them. My previous change removed this since all writes were done with ttymsg() which opens it's own fd, and hence syslogd didn't need it's own fd to send messages on... but this caused an unexpected behavior change. This should close PR#2176
Notes
Notes: svn path=/head/; revision=20290
Diffstat (limited to 'usr.sbin/syslogd/syslogd.c')
-rw-r--r--usr.sbin/syslogd/syslogd.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c
index dce46c1732c2..b90498dcfc16 100644
--- a/usr.sbin/syslogd/syslogd.c
+++ b/usr.sbin/syslogd/syslogd.c
@@ -39,7 +39,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)syslogd.c 8.3 (Berkeley) 4/4/94";
*/
static const char rcsid[] =
- "$Id: syslogd.c,v 1.14 1996/11/26 02:24:42 peter Exp $";
+ "$Id: syslogd.c,v 1.15 1996/11/26 02:35:08 peter Exp $";
#endif /* not lint */
/*
@@ -936,10 +936,9 @@ init(signo)
switch (f->f_type) {
case F_FILE:
case F_FORW:
- (void)close(f->f_file);
- break;
case F_CONSOLE:
case F_TTY:
+ (void)close(f->f_file);
break;
}
next = f->f_next;
@@ -1161,7 +1160,7 @@ cfline(line, f, prog)
case '/':
if ((f->f_file = open(p, O_WRONLY|O_APPEND, 0)) < 0) {
- f->f_file = F_UNUSED;
+ f->f_type = F_UNUSED;
logerror(p);
break;
}
@@ -1170,7 +1169,6 @@ cfline(line, f, prog)
f->f_type = F_CONSOLE;
else
f->f_type = F_TTY;
- close(f->f_file);
(void)strcpy(f->f_un.f_fname, p + sizeof _PATH_DEV - 1);
} else {
(void)strcpy(f->f_un.f_fname, p);