chiark / gitweb /
readahead: fix fd validity check
authorMichal Schmidt <mschmidt@redhat.com>
Mon, 22 Oct 2012 20:07:31 +0000 (22:07 +0200)
committerMichal Schmidt <mschmidt@redhat.com>
Mon, 22 Oct 2012 20:08:06 +0000 (22:08 +0200)
https://bugzilla.redhat.com/show_bug.cgi?id=868603

src/readahead/readahead-collect.c

index a3f7df5..5d07f47 100644 (file)
@@ -460,7 +460,7 @@ static int collect(const char *root) {
                                 log_warning("readlink(%s) failed: %s", fn, strerror(-k));
 
                 next_iteration:
-                        if (m->fd)
+                        if (m->fd >= 0)
                                 close_nointr_nofail(m->fd);
                 }
         }