[Toybox] [PATCH] make partprobe use more toybox functions

Rob Landley rob at landley.net
Sat May 31 15:33:50 PDT 2014


On 05/30/14 13:18, Isaac Dunham wrote:
> 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.

Where's the patch?

> --
> 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;
> }

perror_msg sets exitval if it's 0.

The hard part of this sort of thing is coming up with decent tests for
everything. I keep meaning to properly attack the test suite, but it's
about as big a timesink as doing writeups for cleanups (and updating the
cleanup.html page with full series and stats and such)...

Rob

 1401575630.0


More information about the Toybox mailing list