inotify.c: some format cleanup
This commit is contained in:
parent
4a2665004e
commit
5fd33c5115
1 changed files with 22 additions and 29 deletions
|
|
@ -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;
|
||||||
|
|
@ -164,27 +163,21 @@ static void proc_event(inoev *iev) {
|
||||||
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) {
|
if (event->dir) {
|
||||||
dprint("IN_CREATE on directory, adding\n");
|
dprint("IN_CREATE on directory, adding\n");
|
||||||
addwatch(event->path, event->filename, 0);
|
addwatch(event->path, event->filename, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
type = NOTIFY_CREATE;
|
type = NOTIFY_CREATE;
|
||||||
break;
|
break;
|
||||||
case IN_MOVED_TO :
|
case IN_MOVED_TO :
|
||||||
|
|
||||||
if (event->dir) {
|
if (event->dir) {
|
||||||
dprint("IN_MOVED_TO on directory, adding\n");
|
dprint("IN_MOVED_TO on directory, adding\n");
|
||||||
addwatch(event->path, event->filename, 1);
|
addwatch(event->path, event->filename, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
type = NOTIFY_CREATE;
|
type = NOTIFY_CREATE;
|
||||||
break;
|
break;
|
||||||
case IN_MOVED_FROM :
|
case IN_MOVED_FROM :
|
||||||
|
|
||||||
if (event->dir)
|
if (event->dir)
|
||||||
rmwatch(event->path, event->filename);
|
rmwatch(event->path, event->filename);
|
||||||
case IN_DELETE :
|
case IN_DELETE :
|
||||||
|
|
|
||||||
Reference in a new issue