Make fproc more reliable (fool-proof).

For some reason I have found empty files showing up in cache dirs, this should at least clean them up.
This commit is contained in:
Uriel 2008-12-16 07:02:36 +00:00
parent bd54b147f1
commit 4d36a9a57d

View file

@ -9,7 +9,7 @@ score=`{{tee $tmpfile || exit 1} | sha1sum}
cachedir=/tmp/fproc_cache/$score
mkdir -p $cachedir >[2]/dev/null
if(test -f $cachedir/$proc)
if(test -s $cachedir/$proc)
cat $cachedir/$proc
if not {
$proc < $tmpfile | tee $cachedir/$pid