summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1996-12-10 17:52:23 +0000
committerpeter <peter@FreeBSD.org>1996-12-10 17:52:23 +0000
commit97a86f545b543cdc7737630bbde11c37bda2b9f2 (patch)
tree625a822047ff7c2d95f97b18fcff6d669bb757b9 /usr.sbin
parentb569335b9308eb4b8a67b16e0e3dffe2f50bdc7b (diff)
downloadFreeBSD-src-97a86f545b543cdc7737630bbde11c37bda2b9f2.zip
FreeBSD-src-97a86f545b543cdc7737630bbde11c37bda2b9f2.tar.gz
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
Diffstat (limited to 'usr.sbin')
-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 dce46c1..b90498d 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);
OpenPOWER on IntegriCloud