Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F169822605
D59319.id185615.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
923 B
Referenced Files
None
Subscribers
None
D59319.id185615.diff
View Options
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c
--- a/usr.sbin/syslogd/syslogd.c
+++ b/usr.sbin/syslogd/syslogd.c
@@ -2549,6 +2549,7 @@
closelogfiles(void)
{
struct filed *f;
+ bool defer_free;
while (!STAILQ_EMPTY(&fhead)) {
f = STAILQ_FIRST(&fhead);
@@ -2558,6 +2559,13 @@
if (f->f_prevcount)
fprintlog_successive(f, 0);
+ /*
+ * If a piped process is running, then defer the filed
+ * cleanup until it exits. close_filed() below sets
+ * f_type to F_UNUSED, so capture this before calling it.
+ */
+ defer_free = (f->f_type == F_PIPE && f->f_procdesc != -1);
+
switch (f->f_type) {
case F_FILE:
case F_FORW:
@@ -2585,11 +2593,7 @@
free(f->f_prop_filter);
}
- /*
- * If a piped process is running, then defer the filed
- * cleanup until it exits.
- */
- if (f->f_type != F_PIPE || f->f_procdesc == -1)
+ if (!defer_free)
free(f);
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Sep 3, 4:29 PM (12 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38088758
Default Alt Text
D59319.id185615.diff (923 B)
Attached To
Mode
D59319: syslogd: reap pipe children on config reload
Attached
Detach File
Event Timeline
Log In to Comment