server: fread() - check <= 0 return value
authorJens Axboe <axboe@kernel.dk>
Mon, 10 Oct 2011 19:16:55 +0000 (21:16 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 10 Oct 2011 19:16:55 +0000 (21:16 +0200)
Signed-off-by: Jens Axboe <axboe@kernel.dk>
server.c

index 4f9c02310563604c08064209af92567a306acbe6..5506ca9fedbbb860f7df89b02147d507a0d394ec 100644 (file)
--- a/server.c
+++ b/server.c
@@ -938,7 +938,7 @@ static int check_existing_pidfile(const char *pidfile)
        if (!f)
                return 0;
 
        if (!f)
                return 0;
 
-       if (fread(buf, sb.st_size, 1, f) < 0) {
+       if (fread(buf, sb.st_size, 1, f) <= 0) {
                fclose(f);
                return 1;
        }
                fclose(f);
                return 1;
        }