From owner-svn-src-all@FreeBSD.ORG Sun May 18 15:28:26 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4E59B9B1; Sun, 18 May 2014 15:28:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 212752280; Sun, 18 May 2014 15:28:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4IFSQ9R077487; Sun, 18 May 2014 15:28:26 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4IFSPmY077485; Sun, 18 May 2014 15:28:25 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201405181528.s4IFSPmY077485@svn.freebsd.org> From: John Baldwin Date: Sun, 18 May 2014 15:28:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r266400 - stable/10/usr.sbin/mfiutil X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2014 15:28:26 -0000 Author: jhb Date: Sun May 18 15:28:25 2014 New Revision: 266400 URL: http://svnweb.freebsd.org/changeset/base/266400 Log: MFC 264765,264766: - Don't claim the adapter is idle if it is clearing a drive. - Fix an off by one error when checking for the stop event. This resulted in not showing the most recent event by default. - When the stop even is hit, break out of the outer loop to stop fetching more events. Modified: stable/10/usr.sbin/mfiutil/mfi_evt.c stable/10/usr.sbin/mfiutil/mfi_show.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/mfiutil/mfi_evt.c ============================================================================== --- stable/10/usr.sbin/mfiutil/mfi_evt.c Sun May 18 14:25:19 2014 (r266399) +++ stable/10/usr.sbin/mfiutil/mfi_evt.c Sun May 18 15:28:25 2014 (r266400) @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -534,6 +535,7 @@ show_events(int ac, char **av) struct mfi_evt_log_state info; struct mfi_evt_list *list; union mfi_evt filter; + bool first; long val; char *cp; ssize_t size; @@ -640,7 +642,9 @@ show_events(int ac, char **av) close(fd); return (ENOMEM); } - for (seq = start;;) { + first = true; + seq = start; + for (;;) { if (mfi_get_events(fd, list, num_events, filter, seq, &status) < 0) { error = errno; @@ -650,8 +654,6 @@ show_events(int ac, char **av) return (error); } if (status == MFI_STAT_NOT_FOUND) { - if (seq == start) - warnx("No matching events found"); break; } if (status != MFI_STAT_OK) { @@ -669,13 +671,14 @@ show_events(int ac, char **av) * the case that our stop point is earlier in * the buffer than our start point. */ - if (list->event[i].seq >= stop) { + if (list->event[i].seq > stop) { if (start <= stop) - break; + goto finish; else if (list->event[i].seq < start) - break; + goto finish; } mfi_decode_evt(fd, &list->event[i], verbose); + first = false; } /* @@ -686,6 +689,9 @@ show_events(int ac, char **av) seq = list->event[list->count - 1].seq + 1; } +finish: + if (first) + warnx("No matching events found"); free(list); close(fd); Modified: stable/10/usr.sbin/mfiutil/mfi_show.c ============================================================================== --- stable/10/usr.sbin/mfiutil/mfi_show.c Sun May 18 14:25:19 2014 (r266399) +++ stable/10/usr.sbin/mfiutil/mfi_show.c Sun May 18 15:28:25 2014 (r266400) @@ -766,7 +766,7 @@ show_progress(int ac, char **av __unused printf("drive %s ", mfi_drive_name(NULL, device_id, MFI_DNAME_DEVICE_ID|MFI_DNAME_HONOR_OPTS)); mfi_display_progress("Clear", &pinfo.prog_info.clear); - + busy = 1; } }