ping pong: fix logic for mmap reads vs. preads
authorMichael Adam <obnox@samba.org>
Tue, 12 May 2009 05:56:23 +0000 (07:56 +0200)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Wed, 13 May 2009 06:13:14 +0000 (16:13 +1000)
Michael

utils/ping_pong/ping_pong.c

index fd0e99b23919d7a6fa50df5074ad812a1084f0dd..90692e59ecc51f2751d34664d96e5e4f60047c92 100644 (file)
@@ -115,7 +115,7 @@ static void ping_pong(int fd, int num_locks)
                        unsigned char c;
                        if (use_mmap) {
                                c = p[i];
-                       } if (pread(fd, &c, 1, i) != 1) {
+                       } else if (pread(fd, &c, 1, i) != 1) {
                                printf("read failed at %d\n", i);
                        }
                        incr = c - val[i];