]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
wipefs: add missing ifdef
authorRuediger Meier <ruediger.meier@ga-group.nl>
Mon, 25 Jun 2018 13:08:55 +0000 (15:08 +0200)
committerRuediger Meier <ruediger.meier@ga-group.nl>
Mon, 25 Jun 2018 14:49:54 +0000 (16:49 +0200)
Seen on OSX:
misc-utils/wipefs.c:822:5: warning: implicit declaration of function 'rereadpt' is invalid in C99 [-Wimplicit-function-declaration]
                                rereadpt(fd, devname);

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
misc-utils/wipefs.c

index 49c5c8ca11e1040575eac33862a328fedad97093..13a720e85fbce8fa04878e8636bc4ba926002fb8 100644 (file)
@@ -802,7 +802,6 @@ main(int argc, char **argv)
                /*
                 * Erase
                 */
-               size_t i;
                ctl.ndevs = argc - optind;
 
                while (optind < argc) {
@@ -811,10 +810,11 @@ main(int argc, char **argv)
                        ctl.ndevs--;
                }
 
+#ifdef BLKRRPART
                /* Re-read partition tables on whole-disk devices. This is
                 * postponed until all is done to avoid conflicts.
                 */
-               for (i = 0; i < ctl.nrereads; i++) {
+               for (size_t i = 0; i < ctl.nrereads; i++) {
                        char *devname = ctl.reread[i];
                        int fd = open(devname, O_RDONLY);
 
@@ -824,6 +824,7 @@ main(int argc, char **argv)
                        }
                }
                free(ctl.reread);
+#endif
        }
        return EXIT_SUCCESS;
 }