int opted_in;
int allow_distro_to_pass_on;
char *submit_url;
-
+extern int do_unlink;
void read_config_file(char *filename)
{
if (strstr(c, "yes"))
allow_distro_to_pass_on = 1;
}
+ c = strstr(line, "unlink ");
+ if (c) {
+ c += 14;
+ if (strstr(c, "yes"))
+ do_unlink = 1;
+ }
c = strstr(line, "submit-url ");
if (c) {
c += 11;
#include "corewatcher.h"
+int do_unlink = 0;
#define MAX(A,B) ((A) > (B) ? (A) : (B))
void process_corefile(char *filename)
{
char *ptr;
+ char newfile[8192];
ptr = extract_core(filename);
if (!ptr)
queue_backtrace(ptr);
printf("-%s-\n", ptr);
- unlink(filename);
+ sprintf(newfile,"%s.processed", filename);
+ if (do_unlink)
+ unlink(filename);
+ else
+ rename(filename, newfile);
free(ptr);
}
break;
if (entry->d_name[0] == '.')
continue;
+ if (strstr(entry->d_name, "processed"))
+ continue;
sprintf(path, "/var/cores/%s", entry->d_name);
printf("Looking at %s\n", path);
process_corefile(path);