mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-20 15:43:16 +00:00
Unlink LogName before attempting to open it. Since we now have a lovely
bug in syslogd which causes it to die after random amounts of time (widely reported), this at least allows the administrator to easily restart it without wondering why it simply exits again each time.
This commit is contained in:
parent
a686b628ba
commit
e960bb4911
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=21248
@ -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.15 1996/11/26 02:35:08 peter Exp $";
|
||||
"$Id: syslogd.c,v 1.16 1996/12/10 17:52:23 peter Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
@ -282,6 +282,7 @@ main(argc, argv)
|
||||
memset(&sunx, 0, sizeof(sunx));
|
||||
sunx.sun_family = AF_UNIX;
|
||||
(void)strncpy(sunx.sun_path, LogName, sizeof(sunx.sun_path));
|
||||
(void)unlink(LogName);
|
||||
funix = socket(AF_UNIX, SOCK_DGRAM, 0);
|
||||
if (funix < 0 ||
|
||||
bind(funix, (struct sockaddr *)&sunx, SUN_LEN(&sunx)) < 0 ||
|
||||
|
Loading…
Reference in New Issue
Block a user