char *build_release = NULL;
char *core_folder = NULL;
int url_count = 0;
-int do_unlink = 0;
void read_config_file(char *filename)
{
FILE *file = NULL;
- char *line = NULL, *line_len = NULL;
- size_t dummy = 0;
+ char *line = NULL, *line_end = NULL;
+ size_t line_len = 0;
file = fopen(filename, "r");
if (!file)
char *c = NULL;
char *n = NULL;
- if (getline(&line, &dummy, file) == -1)
+ if (getline(&line, &line_len, file) == -1)
break;
if (line[0] == '#')
continue;
/* we don't care about any lines that are too short to have config options */
- if (dummy < 5)
+ if (line_len < 5)
continue;
/* remove trailing\n */
n = strchr(line, '\n');
if (n) *n = 0;
- line_len = line + dummy;
- c = strstr(line, "unlink");
- if (c)
- if (strstr(c, "yes"))
- do_unlink = 1;
+ line_end = line + line_len;
c = strstr(line, "submit-url");
if (c && url_count <= MAX_URLS) {
c += 11;
- if (c < line_len) {
+ if (c < line_end) {
c = strstr(c, "http:");
if (c) {
submit_url[url_count] = strdup(c);
c = strstr(line, "release-info");
if (c) {
c += 11;
- if (c < line_len) {
+ if (c < line_end) {
c = strstr(c, "/");
if (c)
build_release = strdup(c);
c = strstr(line, "core-folder");
if (c) {
c += 11;
- if (c < line_len) {
+ if (c < line_end) {
c = strstr(c, "/");
if (c)
core_folder = strdup(c);
if (!result) {
char *nf = NULL;
- if (do_unlink || (!(nf = replace_name(oops->filename, ".processed", ".submitted")))) {
- unlink(oops->detail_filename);
- unlink(oops->filename);
- } else {
- rename(oops->filename, nf);
- pthread_mutex_lock(&core_status.processing_mtx);
- remove_pid_from_hash(oops->filename, core_status.processing_oops);
- pthread_mutex_unlock(&core_status.processing_mtx);
- free(nf);
- }
+ nf = replace_name(oops->filename, ".processed", ".submitted");
+ rename(oops->filename, nf);
+ pthread_mutex_lock(&core_status.processing_mtx);
+ remove_pid_from_hash(oops->filename, core_status.processing_oops);
+ pthread_mutex_unlock(&core_status.processing_mtx);
+ free(nf);
g_hash_table_remove(core_status.queued_oops, oops->filename);
count++;