Matthias Scheler wrote:
> Eugene Filatov wrote:
> > Another idea - is it possible to catch file descriptor wich less than 254
> > in the beginning and keep (reserve) it for future use when we will need to
> > dump?
That sounds like a good idea, I think.
> There are still possible race conditions. If you use fclose() which
> calls close() the file descriptor is free to be reused.
How about not closing the file at all, but keeping it open?
Of course, fflush() must be called after each dump (maybe
also fsync()), and fseek(0) and truncate(0) before starting
to write the next dump.
Actually, _two_ file descriptors will be required which are
used alternating, so there's always one complete dump on
the disk, while the other is being written, then rename()
is used to exchange them. But both files can be kept open
all the time, as described above.
I think that should be quite easy to implement. And all
operating systems should benefit from that strategy, not
only Solaris/32bit. It makes sure that the greylist is
always safely stored to the disk, even if some descriptor
limit is approached.
Best regards
Oliver
--
Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing
Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.
"In My Egoistical Opinion, most people's C programs should be indented
six feet downward and covered with dirt."
-- Blair P. HoughtonMessage
Re: [milter-greylist] milter-greylist-2.0.2 crash
2006-01-26 by Oliver Fromme
Attachments
- No local attachments were found for this message.