mirror of
https://github.com/opnsense/src.git
synced 2026-02-18 18:20:26 -05:00
umount: Support partitions & slices with -d option
Signed-off-by: Ricardo Branco <rbranco@suse.de> Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1183 (cherry picked from commit e96d0d7468446d7cabd76ae213889297711bb144)
This commit is contained in:
parent
f9b66c0040
commit
4de324578f
1 changed files with 4 additions and 6 deletions
|
|
@ -685,19 +685,17 @@ md_detach(const char *device)
|
|||
char *eptr;
|
||||
int fd;
|
||||
|
||||
memset(&mdio, 0, sizeof(mdio));
|
||||
|
||||
mdio.md_version = MDIOVERSION;
|
||||
mdio.md_options = fflag ? MD_FORCE : 0;
|
||||
|
||||
if (strncmp(device, DEV_MD, sizeof(DEV_MD) - 1)) {
|
||||
if (!all)
|
||||
warnx("invalid md device: %s", device);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
memset(&mdio, 0, sizeof(mdio));
|
||||
mdio.md_version = MDIOVERSION;
|
||||
mdio.md_options = fflag ? MD_FORCE : 0;
|
||||
mdio.md_unit = strtoul(device + sizeof(DEV_MD) - 1, &eptr, 0);
|
||||
if (mdio.md_unit == (unsigned)ULONG_MAX || *eptr != '\0') {
|
||||
if (mdio.md_unit == (unsigned)ULONG_MAX || eptr - device == sizeof(DEV_MD) - 1) {
|
||||
warnx("invalid md device: %s", device);
|
||||
return (-1);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue