]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Don't report an error when deleting the denied temporary file
authorFrédéric Marchal <fmarchal@users.sourceforge.net>
Sun, 15 Jul 2012 17:10:27 +0000 (19:10 +0200)
committerFrédéric Marchal <fmarchal@users.sourceforge.net>
Sun, 15 Jul 2012 17:10:27 +0000 (19:10 +0200)
The file can be deleted at two places. If the first call delete it, the
second call must not report an error.

log.c

diff --git a/log.c b/log.c
index 7b20153504a35f2c6d757f28560844bf54f2383f..e1a9ade153793172e96694da042f5045ee534d89 100644 (file)
--- a/log.c
+++ b/log.c
@@ -1693,7 +1693,7 @@ int main(int argc,char *argv[])
                gerarel();
 
        if((ReportType & REPORT_TYPE_DENIED) != 0) {
-               if (!KeepTempLog && unlink(denied_sort))
+               if (!KeepTempLog && unlink(denied_sort) && errno!=ENOENT)
                        debuga(_("Cannot delete \"%s\": %s\n"),denied_sort,strerror(errno));
        }