diff --git a/nand-part.c b/nand-part.c index e1640dc..a0d46c5 100644 --- a/nand-part.c +++ b/nand-part.c @@ -50,8 +50,10 @@ #include #include #include -#include -#include /* BLKRRPART */ +#ifdef __linux__ +# include +# include /* BLKRRPART */ +#endif #include "nand-common.h" // so far, only known formats are for A10 and A20 @@ -249,8 +251,10 @@ static int writembrs(int fd, char names[][MAX_NAME], __u32 start, __u32 *lens, u write(fd,mbr,MBR_SIZE); } +#ifdef __linux__ if (ioctl(fd, BLKRRPART, NULL)) perror("Failed rereading partition table"); +#endif return 1; } @@ -312,7 +316,9 @@ int nand_part (int argc, char **argv, const char *cmd, int fd, int force) if (writembrs(fd, names, start, lens, user_types, argc, partoffset, force)) { printf("\nverifying new partition tables:\n"); checkmbrs(fd); +#ifdef __linux__ printf("rereading partition table... returned %d\n", ioctl(fd, BLKRRPART, 0)); +#endif } } close(fd);