Emulating the presumed proper behavior of the original
program, when the -p switch is used we will now report
an error if that provided name matches some disk name.
Signed-off-by: Jim Warner <james.warner@comcast.net>
if (procps_diskstat_read(disk_stat) < 0)
xerr(EXIT_FAILURE,
_("Unable to read diskstat"));
- if ((partid = procps_diskstat_dev_getbyname(disk_stat, partition_name))
- < 0)
+ if ((partid = procps_diskstat_dev_getbyname(disk_stat, partition_name)) < 0
+ || procps_diskstat_dev_isdisk(disk_stat, partid))
xerrx(EXIT_FAILURE, _("Partition %s not found"), partition_name);
diskpartition_header(partition_name);