[Toybox] [PATCH] make partprobe use more toybox functions
Isaac Dunham
ibid.ag at gmail.com
Fri May 30 11:18:48 PDT 2014
partprobe duplicates a couple of toybox functions; this patch uses the
standard toybox functionality more thoroughly.
Additionally, this brings the help into line with standard toybox
help messages.
--
As far as I can tell, there's nothing left to change except perhaps the
perror_msg; I _think_ this is ready to move from pending/ to other/...
depending what we do about return values.
As far as the return value, the older versions of partprobe always
return success; the newest versions return failure if reloading the
partition table fails. I'm _guessing_ the new version returns
failure if *any* devices cannot be reloaded, but I don't know.
If that behavior is desired instead, update_device becomes:
void update_device(int sd_fd, char *path)
{
if (ioctl(sd_fd, BLKRRPART, NULL)) return;
perror_msg("ioctl (BLKRRPART) failed, old layout still used");
toys.exitval = 1;
}
But this appears to not be needed, given that the submission didn't do
this.
On a completely unrelated note: the mdev change I mentioned seems to
not do what I'd hoped; time for more poking.
I had tried using DEVPATH to find the right directory.
HTH,
Isaac Dunham
More information about the Toybox
mailing list