From 5fd33c511586eb525903b8eb7cba919fb1dc5d28 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Thu, 11 Nov 2010 16:07:48 +0100 Subject: [PATCH] inotify.c: some format cleanup --- src/inotify.c | 51 ++++++++++++++++++++++----------------------------- 1 file changed, 22 insertions(+), 29 deletions(-) diff --git a/src/inotify.c b/src/inotify.c index f174590..1ee0aad 100644 --- a/src/inotify.c +++ b/src/inotify.c @@ -148,9 +148,8 @@ static void proc_event(inoev *iev) { event = notify_event_new(); - if (event == NULL) { + if (!event) return; - } /* set dir and drop that bit off (so its not in the way) */ event->dir = (iev->mask & IN_ISDIR) != 0; @@ -163,33 +162,27 @@ static void proc_event(inoev *iev) { to prevent messing up the order */ queue_enqueue(event_queue, event); - switch (iev->mask) { - - case IN_CREATE : - - if (event->dir) { - dprint("IN_CREATE on directory, adding\n"); - addwatch(event->path, event->filename, 0); - } - - type = NOTIFY_CREATE; - break; - case IN_MOVED_TO : - - if (event->dir) { - dprint("IN_MOVED_TO on directory, adding\n"); - addwatch(event->path, event->filename, 1); - } - - type = NOTIFY_CREATE; - break; - case IN_MOVED_FROM : - - if (event->dir) - rmwatch(event->path, event->filename); - case IN_DELETE : - type = NOTIFY_DELETE; - break; + switch(iev->mask) { + case IN_CREATE : + if (event->dir) { + dprint("IN_CREATE on directory, adding\n"); + addwatch(event->path, event->filename, 0); + } + type = NOTIFY_CREATE; + break; + case IN_MOVED_TO : + if (event->dir) { + dprint("IN_MOVED_TO on directory, adding\n"); + addwatch(event->path, event->filename, 1); + } + type = NOTIFY_CREATE; + break; + case IN_MOVED_FROM : + if (event->dir) + rmwatch(event->path, event->filename); + case IN_DELETE : + type = NOTIFY_DELETE; + break; } event->type = type;