Date: Tue, 15 Dec 2015 13:01:14 +0000 (UTC) From: Baptiste Daroussin <bapt@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292262 - head/usr.sbin/sesutil Message-ID: <201512151301.tBFD1EZZ032204@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bapt Date: Tue Dec 15 13:01:14 2015 New Revision: 292262 URL: https://svnweb.freebsd.org/changeset/base/292262 Log: Show the enclosure name and id in sesutil map Sponsored by: Gandi.net Modified: head/usr.sbin/sesutil/sesutil.c Modified: head/usr.sbin/sesutil/sesutil.c ============================================================================== --- head/usr.sbin/sesutil/sesutil.c Tue Dec 15 12:58:33 2015 (r292261) +++ head/usr.sbin/sesutil/sesutil.c Tue Dec 15 13:01:14 2015 (r292262) @@ -302,6 +302,7 @@ static int objmap(int argc, char **argv __unused) { struct sbuf *extra; + encioc_string_t stri; encioc_elm_devnames_t e_devname; encioc_elm_status_t e_status; encioc_elm_desc_t e_desc; @@ -310,6 +311,7 @@ objmap(int argc, char **argv __unused) int fd; unsigned int j, nobj; size_t i; + char str[32]; if (argc != 1) { usage(stderr, "map"); @@ -355,6 +357,15 @@ objmap(int argc, char **argv __unused) } printf("%s:\n", g.gl_pathv[i] + 5); + stri.bufsiz = sizeof(str); + stri.buf = &str[0]; + if (ioctl(fd, ENCIOC_GETENCNAME, (caddr_t) &stri) == 0) + printf("\tEnclosure Name: %s\n", stri.buf); + stri.bufsiz = sizeof(str); + stri.buf = &str[0]; + if (ioctl(fd, ENCIOC_GETENCID, (caddr_t) &stri) == 0) + printf("\tEnclosure ID: %s\n", stri.buf); + for (j = 0; j < nobj; j++) { /* Get the status of the element */ memset(&e_status, 0, sizeof(e_status));
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201512151301.tBFD1EZZ032204>