Skip to content

Commit

Permalink
wipefs: add missing ifdef
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
rudimeier committed Jun 25, 2018
1 parent 24c329b commit 3097f78
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions misc-utils/wipefs.c
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,6 @@ main(int argc, char **argv)
/*
* Erase
*/
size_t i;
ctl.ndevs = argc - optind;

while (optind < argc) {
Expand All @@ -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);

Expand All @@ -824,6 +824,7 @@ main(int argc, char **argv)
}
}
free(ctl.reread);
#endif
}
return EXIT_SUCCESS;
}

0 comments on commit 3097f78

Please sign in to comment.