Date: Tue, 5 Jan 2010 13:55:49 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r201584 - stable/8/usr.sbin/diskinfo Message-ID: <201001051355.o05Dtnow015884@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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");
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001051355.o05Dtnow015884>