svn commit: r201584 - stable/8/usr.sbin/diskinfo
Alexander Motin
mav at FreeBSD.org
Tue Jan 5 13:55:49 UTC 2010
Author: mav
Date: Tue Jan 5 13:55:49 2010
New Revision: 201584
URL: http://svn.freebsd.org/changeset/base/201584
Log:
MFC r196799:
Don't bother obtaining the ident if we are not going to print it.
Modified:
stable/8/usr.sbin/diskinfo/diskinfo.c
Directory Properties:
stable/8/usr.sbin/diskinfo/ (props changed)
Modified: stable/8/usr.sbin/diskinfo/diskinfo.c
==============================================================================
--- stable/8/usr.sbin/diskinfo/diskinfo.c Tue Jan 5 13:51:23 2010 (r201583)
+++ stable/8/usr.sbin/diskinfo/diskinfo.c Tue Jan 5 13:55:49 2010 (r201584)
@@ -104,9 +104,6 @@ main(int argc, char **argv)
error = ioctl(fd, DIOCGFWHEADS, &fwheads);
if (error)
fwheads = 0;
- error = ioctl(fd, DIOCGIDENT, ident);
- if (error)
- ident[0] = '\0';
if (!opt_v) {
printf("%s", argv[i]);
printf("\t%u", sectorsize);
@@ -133,7 +130,7 @@ main(int argc, char **argv)
printf("\t%-12u\t# Heads according to firmware.\n", fwheads);
printf("\t%-12u\t# Sectors according to firmware.\n", fwsectors);
}
- if (ident[0] != '\0')
+ if (ioctl(fd, DIOCGIDENT, ident) == 0)
printf("\t%-12s\t# Disk ident.\n", ident);
}
printf("\n");
More information about the svn-src-stable
mailing list