void *readable_callback_user;
int fd;
- const char *path; /* ptr copy of path_<foo> or feedfile */
struct Filemon_Perfile *filemon;
oop_read *rd;
off_t offset;
Counts counts;
+ char path[];
} InputFile;
typedef enum {
sysfatal("unable to open input file %s", path);
}
- InputFile *ipf= xmalloc(sizeof(InputFile));
+ InputFile *ipf= xmalloc(sizeof(*ipf) + strlen(path) + 1);
memset(ipf,0,sizeof(*ipf));
ipf->readable.on_readable= tailing_on_readable;
ipf->readable.try_read= tailing_try_read;
ipf->fd= fd;
- ipf->path= path;
+ strcpy(ipf->path, path);
return ipf;
}
if (ipf->fd >= 0)
if (close(ipf->fd)) sysdie("could not close input file %s", ipf->path);
- fixme maybe free ipf->path;
-
free(ipf);
}
debug("backlog scan: found age=%f deficiency=%ld oldest=%s",
age, age_deficiency, oldest_path);
- backlog_input_file= open_input_file();
+ backlog_input_file= open_input_file(oldest_path);
if (!backlog_input_file) {
warn("backlog file %s vanished as we opened it", backlog_input_file);
goto try_again;