]> git.ipfire.org Git - thirdparty/sarg.git/blobdiff - realtime.c
Keep temporary files in place for inspection
[thirdparty/sarg.git] / realtime.c
index a2d7c7f2eb8d914783614583dc54de4e331a54ce..746286b9eded9b11b6d18dd3c86b52a5f16ec63b 100755 (executable)
@@ -104,8 +104,8 @@ static void getlog(void)
                debuga(_("sort command: %s\n"),cmd);
                exit(EXIT_FAILURE);
        }
-       if (unlink(template1)) {
-               debuga(_("Cannot delete %s - %s\n"),template1,strerror(errno));
+       if (!KeepTempLog && unlink(template1)) {
+               debuga(_("Cannot delete \"%s\": %s\n"),template1,strerror(errno));
                exit(EXIT_FAILURE);
        }
        datashow(template2);
@@ -288,8 +288,8 @@ static void datashow(const char *tmp)
 
        puts("</table>\n</div>\n</body>\n</html>\n");
        fclose(fin);
-       if (unlink(tmp)) {
-               debuga(_("Cannot delete %s - %s\n"),tmp,strerror(errno));
+       if (!KeepTempLog && unlink(tmp)) {
+               debuga(_("Cannot delete \"%s\": %s\n"),tmp,strerror(errno));
                exit(EXIT_FAILURE);
        }
        fflush(NULL);