From f71abed76bd2eacc6ebf43663059631c7cf213ed Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sat, 31 May 2014 18:00:04 -0500 Subject: Promote partprobe. --- toys/other/partprobe.c | 30 ++++++++++++++++++++++++++++++ toys/pending/partprobe.c | 30 ------------------------------ 2 files changed, 30 insertions(+), 30 deletions(-) create mode 100644 toys/other/partprobe.c delete mode 100644 toys/pending/partprobe.c diff --git a/toys/other/partprobe.c b/toys/other/partprobe.c new file mode 100644 index 00000000..5c44cb3f --- /dev/null +++ b/toys/other/partprobe.c @@ -0,0 +1,30 @@ +/* partprobe.c - Tell the kernel about partition table changes + * + * Copyright 2014 Bertold Van den Bergh + * + * see http://man7.org/linux/man-pages/man8/partprobe.8.html + +USE_PARTPROBE(NEWTOY(partprobe, "<1", TOYFLAG_SBIN)) + +config PARTPROBE + bool "partprobe" + default y + help + usage: partprobe DEVICE... + + Tell the kernel about partition table changes + + Ask the kernel to re-read the partition table on the specified devices. +*/ + +#include "toys.h" + +static void do_partprobe(int fd, char *name) +{ + if (ioctl(fd, BLKRRPART, 0)) perror_msg("ioctl failed"); +} + +void partprobe_main(void) +{ + loopfiles(toys.optargs, do_partprobe); +} diff --git a/toys/pending/partprobe.c b/toys/pending/partprobe.c deleted file mode 100644 index e0beb009..00000000 --- a/toys/pending/partprobe.c +++ /dev/null @@ -1,30 +0,0 @@ -/* partprobe.c - Tell the kernel about partition table changes - * - * Copyright 2014 Bertold Van den Bergh - * - * see http://man7.org/linux/man-pages/man8/partprobe.8.html - -USE_PARTPROBE(NEWTOY(partprobe, "<1", TOYFLAG_SBIN)) - -config PARTPROBE - bool "partprobe" - default n - help - usage: partprobe DEVICE... - - Tell the kernel about partition table changes - - Ask the kernel to re-read the partition table on the specified devices. -*/ - -#include "toys.h" - -static void do_partprobe(int fd, char *name) -{ - if (ioctl(fd, BLKRRPART, 0)) perror_msg("ioctl failed"); -} - -void partprobe_main(void) -{ - loopfiles(toys.optargs, do_partprobe); -} -- cgit v1.2.3