From owner-svn-src-head@FreeBSD.ORG Sat Jun 8 20:47:44 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 08E31E4C; Sat, 8 Jun 2013 20:47:44 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EF85612D6; Sat, 8 Jun 2013 20:47:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r58Klh9u003842; Sat, 8 Jun 2013 20:47:43 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r58KlhDK003841; Sat, 8 Jun 2013 20:47:43 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201306082047.r58KlhDK003841@svn.freebsd.org> From: Devin Teske Date: Sat, 8 Jun 2013 20:47:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251554 - head/usr.sbin/bsdconfig/console X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Jun 2013 20:47:44 -0000 Author: dteske Date: Sat Jun 8 20:47:43 2013 New Revision: 251554 URL: http://svnweb.freebsd.org/changeset/base/251554 Log: Don't silently ignore errors (found while testing with `chflags schg /etc/ttys). Modified: head/usr.sbin/bsdconfig/console/ttys Modified: head/usr.sbin/bsdconfig/console/ttys ============================================================================== --- head/usr.sbin/bsdconfig/console/ttys Sat Jun 8 20:43:13 2013 (r251553) +++ head/usr.sbin/bsdconfig/console/ttys Sat Jun 8 20:47:43 2013 (r251554) @@ -108,7 +108,7 @@ dialog_menu_main() # ttys_set_type() { - local consterm="$1" + local consterm="$1" err # # Create new temporary file to write our ttys(5) update with new types. @@ -130,7 +130,7 @@ ttys_set_type() # Operate on ttys(5), replacing only the types of `ttyv*' and # `cons[0-9]' terminals with the new type. # - awk -v consterm="$consterm" ' + if ! err=$( awk -v consterm="$consterm" ' BEGIN { } { @@ -152,8 +152,14 @@ ttys_set_type() right = substr($0, RSTART) printf "%s%s%s\n", left, consterm, right } - ' "$ETC_TTYS" > "$tmpfile" || return $FAILURE - f_quietly mv -f "$tmpfile" "$ETC_TTYS" || return $FAILURE + ' "$ETC_TTYS" > "$tmpfile" 2>&1 ); then + f_dialog_msgbox "$err" + return $FAILURE + fi + if ! err=$( mv -f "$tmpfile" "$ETC_TTYS" 2>&1 ); then + f_dialog_msgbox "$err" + return $FAILURE + fi return $SUCCESS } @@ -190,10 +196,7 @@ while :; do [ "$mtag" = "1 $msg_none" ] && break f_dialog_menuitem_fetch consterm - err=$( ttys_set_type "$consterm" 2>&1 ) - [ "$err" ] || break # to success - - f_dialog_msgbox "$err" + ttys_set_type "$consterm" && break done exit $SUCCESS