]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: result of operation is garbage or undefined [clang analyze]
authorKarel Zak <kzak@redhat.com>
Tue, 29 Mar 2016 13:44:48 +0000 (15:44 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 29 Mar 2016 13:44:48 +0000 (15:44 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/monitor.c

index 9f9e2ba81d538486ec297f9dc966e4acaedf30f4..a4b2e018cb9c15a834fa22dfb9546d10f20e0fdc 100644 (file)
@@ -313,7 +313,7 @@ static int userspace_event_verify(struct libmnt_monitor *mn,
 
        DBG(MONITOR, ul_debugobj(mn, "drain and verify userspace monitor inotify"));
 
-       /* the 'fd' is non-blocking */
+       /* the me->fd is non-blocking */
        do {
                ssize_t len;
                char *p;
@@ -326,7 +326,7 @@ static int userspace_event_verify(struct libmnt_monitor *mn,
                for (p = buf; p < buf + len;
                     p += sizeof(struct inotify_event) + e->len) {
 
-                       int fd;
+                       int fd = -1;
 
                        e = (const struct inotify_event *) p;
                        DBG(MONITOR, ul_debugobj(mn, " inotify event 0x%x [%s]\n", e->mask, e->len ? e->name : ""));