Ignore implemented

This commit is contained in:
Albert S. 2013-06-12 22:55:30 +02:00
父節點 771327286e
當前提交 58f2a92a4e
共有 1 個檔案被更改,包括 4 行新增2 行删除

查看文件

@ -99,7 +99,7 @@ char *find_ifd_path(int ifd)
bool is_ignored(const char *str) bool is_ignored(const char *str)
{ {
for(struct ignorelist *l = ignorelist_head; l != NULL; l = l->next) for(struct ignorelist *l = ignorelist_head; l != NULL; l = l->next)
if(fnmatch(str, l->ignore, 0) == 0) if(fnmatch(l->ignore, str, 0) == 0)
return true; return true;
return false; return false;
} }
@ -341,6 +341,8 @@ void handle_event(struct inotify_event *event, uint32_t mask, char *prog, const
logerror("Could not get absoulte path for event. Watch descriptor %i\n", event->wd); logerror("Could not get absoulte path for event. Watch descriptor %i\n", event->wd);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
if(is_ignored(eventfile_abspath)) return;
logwrite("Starting execution of child %s\n", prog); logwrite("Starting execution of child %s\n", prog);
bool r = run(prog, eventfile_abspath, logfile, event->mask, noappend); bool r = run(prog, eventfile_abspath, logfile, event->mask, noappend);
@ -378,7 +380,7 @@ int main(int argc, char **argv)
signal(SIGCHLD, SIG_IGN); signal(SIGCHLD, SIG_IGN);
while((option = getopt(argc, argv, "absdo:w:m:l:")) != -1) while((option = getopt(argc, argv, "absdo:w:m:l:i:")) != -1)
{ {
switch(option) switch(option)
{ {