Page MenuHomeFreeBSD

D59319.id185615.diff
No OneTemporary

D59319.id185615.diff

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

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)

Event Timeline