DIR *dir;
struct dirent *entry;
char path[PATH_MAX*2];
+ struct oops *oq;
dir = opendir("/tmp/");
if (!dir)
fprintf(stderr, "+ scanning %s...\n", core_folder);
do {
+ skip:
+ memset(path, 0, PATH_MAX*2);
+ oq = get_oops_queue();
entry = readdir(dir);
if (!entry)
break;
if (!strstr(entry->d_name, ".processed"))
continue;
sprintf(path, "%s%s", core_folder, entry->d_name);
+ while (oq) {
+ if (!(strcmp(oq->filename, path)))
+ goto skip;
+ oq = oq->next;
+ }
fprintf(stderr, "+ Looking at %s\n", path);
process_corefile(path);
- } while(entry);
+ } while(1);
closedir(dir);
if (opted_in >= 2)
extern int scan_dmesg(void * unused);
extern void read_config_file(char *filename);
-
+extern struct oops *get_oops_queue(void);
extern void ask_permission(char *detail_folder);
extern void dbus_ask_permission(char *detail_folder);
extern void dbus_say_thanks(char *url);
static int newoops;
static int unsubmittedoops;
+struct oops *get_oops_queue(void)
+{
+ return queued_backtraces;
+}
+
static unsigned int checksum(char *ptr)
{
unsigned int temp = 0;
checksums[submitted++] = oops->checksum;
dbus_say_thanks(result_url);
- }
+ } else
+ queue_backtrace(oops);
count++;
dup:
void submit_queue(void)
{
- int i, n;
+ int i, n, submitted = 0;
struct oops *queue, *oops, *next;
CURL *handle;
pxProxyFactory *pf;
}
if (!curl_easy_perform(handle)) {
submit_queue_with_url(queue, submit_url[i], proxy);
+ submitted = 1;
break;
}
for (n = 0; proxies[n]; n++)
px_proxy_factory_free(pf);
- oops = queue;
- while (oops) {
- next = oops->next;
- FREE_OOPS(oops);
- oops = next;
- }
+ if (submitted) {
+ oops = queue;
+ while (oops) {
+ next = oops->next;
+ FREE_OOPS(oops);
+ oops = next;
+ }
+ } else
+ queued_backtraces = queue;
curl_easy_cleanup(handle);
}