Don't bother obtaining the ident if we are not going to print it.

This commit is contained in:
Pawel Jakub Dawidek 2009-09-03 22:19:09 +00:00
parent 1219197b46
commit 18e5fe2840

View File

@ -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");