http://bugzilla.spamassassin.org/show_bug.cgi?id=3608
Summary: razor-agent.log stays open after processing
Product: Spamassassin
Version: SVN Trunk (Latest Devel Version)
Platform: Other
OS/Version: other
Status: NEW
Severity: normal
Priority: P5
Component: Rules (Eval Tests)
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]
it's opened when calling do_conf(), but is apparently never closed. the good
news is that since it keeps
reusing the same GLOB name, it also reuses the same file descriptor, so it's
not like we're constantly
eating up fds in things like spamd.
it looks like we can do something like:
if (ref($rc->{logref}) && $rc->{LogType} eq 'file') {
close($rc->{logref}->{fd});
}
at the end of our razor check. unfortunately, {fd} there can either be a file
IO::Handle, STDOUT IO::
Handle, or STDERR IO::Handle (aka: *STDERR{IO} and not \*STDERR). so we'd need
to add in a check
that makes sure we don't close STDOUT or STDERR. something like:
my $foo = $rc->{logref}->{fd};
foreach(*STDOUT{IO}, *STDERR{IO}) {
if ($foo == $_) {
undef $foo;
last;
}
}
close($foo) if (defined $foo);
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.