[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: savelog can lose data



> [call to reality snipped]

erm. yes i actually did know that. i was either very tired or heavily
drugged when i wrote my last message. possibly both. the submitted patch is
in fact exactly what's necessary. my only point is that the truncation of
the file should probably be done with : > $filename rather than echo -n >
$filename. (> $filename without any command is not portable enough.) it's
possible to eliminate the race condition by adding a unique line to the
bottom of the file immediately before the copy and playing with awk to
ensure that the right things are in both files, but that's really not worth
it; alternatively one could use the severe linuxism of mandatory file
locking but that also really isn't worth it. (of course i will change my
mind about this when i actually lose an important syslog line.)

--phouchg
"For a price I'd do about anything, except pull the trigger: for that I'd
need a pretty good cause" -- Queensryche, "Revolution Calling"
PGP 5.0 key (0xE024447449) at http://cif.rochester.edu/~jpt/pubkey.txt


Reply to: