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
This commit is contained in:
Peter Wemm 1996-12-10 17:52:23 +00:00
parent 13629194a5
commit 5bb4699e9c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=20290

View File

@ -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);