From 3097f788f99804957a8ffb3797ed49cb599daeb7 Mon Sep 17 00:00:00 2001 From: Ruediger Meier Date: Mon, 25 Jun 2018 15:08:55 +0200 Subject: [PATCH] wipefs: add missing ifdef 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 --- misc-utils/wipefs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/misc-utils/wipefs.c b/misc-utils/wipefs.c index 49c5c8ca1..13a720e85 100644 --- a/misc-utils/wipefs.c +++ b/misc-utils/wipefs.c @@ -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; }