Archived
1
0
Fork 0

inotify.c: some format cleanup

This commit is contained in:
Henrik Hautakoski 2010-11-11 16:07:48 +01:00
parent 4a2665004e
commit 5fd33c5115

View file

@ -148,9 +148,8 @@ static void proc_event(inoev *iev) {
event = notify_event_new(); event = notify_event_new();
if (event == NULL) { if (!event)
return; return;
}
/* set dir and drop that bit off (so its not in the way) */ /* set dir and drop that bit off (so its not in the way) */
event->dir = (iev->mask & IN_ISDIR) != 0; event->dir = (iev->mask & IN_ISDIR) != 0;
@ -163,33 +162,27 @@ static void proc_event(inoev *iev) {
to prevent messing up the order */ to prevent messing up the order */
queue_enqueue(event_queue, event); queue_enqueue(event_queue, event);
switch (iev->mask) { switch(iev->mask) {
case IN_CREATE :
case IN_CREATE : if (event->dir) {
dprint("IN_CREATE on directory, adding\n");
if (event->dir) { addwatch(event->path, event->filename, 0);
dprint("IN_CREATE on directory, adding\n"); }
addwatch(event->path, event->filename, 0); type = NOTIFY_CREATE;
} break;
case IN_MOVED_TO :
type = NOTIFY_CREATE; if (event->dir) {
break; dprint("IN_MOVED_TO on directory, adding\n");
case IN_MOVED_TO : addwatch(event->path, event->filename, 1);
}
if (event->dir) { type = NOTIFY_CREATE;
dprint("IN_MOVED_TO on directory, adding\n"); break;
addwatch(event->path, event->filename, 1); case IN_MOVED_FROM :
} if (event->dir)
rmwatch(event->path, event->filename);
type = NOTIFY_CREATE; case IN_DELETE :
break; type = NOTIFY_DELETE;
case IN_MOVED_FROM : break;
if (event->dir)
rmwatch(event->path, event->filename);
case IN_DELETE :
type = NOTIFY_DELETE;
break;
} }
event->type = type; event->type = type;