diff options
author | pjd <pjd@FreeBSD.org> | 2009-09-03 22:19:09 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2009-09-03 22:19:09 +0000 |
commit | b0ecf3a925a65d16f281bd25ab840f9d9fe37981 (patch) | |
tree | 2939f465a66752c907a0af2122658ea9b9c568ba | |
parent | 45a57a7a4adb23bb53dea8e14d30f8bcc9091202 (diff) | |
download | FreeBSD-src-b0ecf3a925a65d16f281bd25ab840f9d9fe37981.zip FreeBSD-src-b0ecf3a925a65d16f281bd25ab840f9d9fe37981.tar.gz |
Don't bother obtaining the ident if we are not going to print it.
-rw-r--r-- | usr.sbin/diskinfo/diskinfo.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/usr.sbin/diskinfo/diskinfo.c b/usr.sbin/diskinfo/diskinfo.c index 48b019b..7ecf7cb 100644 --- a/usr.sbin/diskinfo/diskinfo.c +++ b/usr.sbin/diskinfo/diskinfo.c @@ -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"); |