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