Fix CID 574 - tidies up the code expression.
authorJeremy Allison <jra@samba.org>
Wed, 29 Oct 2008 23:28:04 +0000 (16:28 -0700)
committerJeremy Allison <jra@samba.org>
Wed, 29 Oct 2008 23:28:04 +0000 (16:28 -0700)
Jeremy.

source/smbd/notify_inotify.c

index fa0f0ed51dc9202e4c355fa0fba0587fb864e7cc..c6c12a9cd2d02dc82467aafd0de06f51fa37cf97 100644 (file)
@@ -243,14 +243,14 @@ static void inotify_handler(struct event_context *ev, struct fd_event *fde,
        e0 = e = (struct inotify_event *)TALLOC_SIZE(in, bufsize);
        if (e == NULL) return;
 
-       if (read(in->fd, e0, bufsize) != bufsize) {
+       if (sys_read(in->fd, e0, bufsize) != bufsize) {
                DEBUG(0,("Failed to read all inotify data\n"));
                talloc_free(e0);
                return;
        }
 
        /* we can get more than one event in the buffer */
-       while (bufsize >= sizeof(*e)) {
+       while (e && (bufsize >= sizeof(*e))) {
                struct inotify_event *e2 = NULL;
                bufsize -= e->len + sizeof(*e);
                if (bufsize >= sizeof(*e)) {