Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F137434171
D3081.id6935.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D3081.id6935.diff
View Options
Index: usr.sbin/syslogd/syslogd.c
===================================================================
--- usr.sbin/syslogd/syslogd.c
+++ usr.sbin/syslogd/syslogd.c
@@ -1025,6 +1025,7 @@
sizeof(f->f_lasttime));
fprintlog(f, flags, msg);
(void)close(f->f_file);
+ f->f_file = -1;
}
(void)sigsetmask(omask);
return;
@@ -1314,6 +1315,7 @@
if (errno != ENOSPC) {
int e = errno;
(void)close(f->f_file);
+ f->f_file = -1;
f->f_type = F_UNUSED;
errno = e;
logerror(f->f_un.f_fname);
@@ -1339,6 +1341,7 @@
if (writev(f->f_file, iov, IOV_SIZE) < 0) {
int e = errno;
(void)close(f->f_file);
+ f->f_file = -1;
if (f->f_un.f_pipe.f_pid > 0)
deadq_enter(f->f_un.f_pipe.f_pid,
f->f_un.f_pipe.f_pname);
@@ -1447,6 +1450,7 @@
if (f->f_type == F_PIPE &&
f->f_un.f_pipe.f_pid == pid) {
(void)close(f->f_file);
+ f->f_file = -1;
f->f_un.f_pipe.f_pid = 0;
log_deadchild(pid, status,
f->f_un.f_pipe.f_pname);
@@ -1551,6 +1555,7 @@
fprintlog(f, 0, (char *)NULL);
if (f->f_type == F_PIPE && f->f_un.f_pipe.f_pid > 0) {
(void)close(f->f_file);
+ f->f_file = -1;
f->f_un.f_pipe.f_pid = 0;
}
}
@@ -1635,10 +1640,12 @@
case F_CONSOLE:
case F_TTY:
(void)close(f->f_file);
+ f->f_file = -1;
break;
case F_PIPE:
if (f->f_un.f_pipe.f_pid > 0) {
(void)close(f->f_file);
+ f->f_file = -1;
deadq_enter(f->f_un.f_pipe.f_pid,
f->f_un.f_pipe.f_pname);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 24, 10:30 AM (3 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26012792
Default Alt Text
D3081.id6935.diff (1 KB)
Attached To
Mode
D3081: Set f_file to -1/F_UNUSED when possible after closing it to avoid trashing/double-closing file descriptors later
Attached
Detach File
Event Timeline
Log In to Comment