From owner-svn-src-head@FreeBSD.ORG Sun Jun 2 23:18:28 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 35CFA883; Sun, 2 Jun 2013 23:18:28 +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 263CA1CAC; Sun, 2 Jun 2013 23:18:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r52NISMo093595; Sun, 2 Jun 2013 23:18:28 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r52NISbw093594; Sun, 2 Jun 2013 23:18:28 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201306022318.r52NISbw093594@svn.freebsd.org> From: Devin Teske Date: Sun, 2 Jun 2013 23:18:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251275 - head/usr.sbin/bsdconfig/share/media 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: Sun, 02 Jun 2013 23:18:28 -0000 Author: dteske Date: Sun Jun 2 23:18:27 2013 New Revision: 251275 URL: http://svnweb.freebsd.org/changeset/base/251275 Log: Fix a bug that would cause a spurious warning to appear to appear in an edge-case. The case was that you have been through the FTP setup once before and on the second time through, you cancel at the re-selection of a new FTP server. The spurious warning was "device_media: not found" and was caused because the underlying call to f_device_network_down() did not check to see if the network device existed before attempting to shut it down. Add checks to make sure we don't forge ahead unless the device exists. Modified: head/usr.sbin/bsdconfig/share/media/ftp.subr Modified: head/usr.sbin/bsdconfig/share/media/ftp.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/ftp.subr Sun Jun 2 23:15:12 2013 (r251274) +++ head/usr.sbin/bsdconfig/share/media/ftp.subr Sun Jun 2 23:18:27 2013 (r251275) @@ -502,6 +502,7 @@ f_media_set_ftp_userpass() f_device_network_up() { local dev="$1" netDev + f_struct device_$dev || return $FAILURE device_$dev get private netDev || return $SUCCESS # No net == happy net f_device_init $netDev } @@ -513,6 +514,7 @@ f_device_network_up() f_device_network_down() { local dev="$1" netDev + f_struct device_$dev || return $FAILURE device_$dev get private netDev || return $SUCCESS f_device_shutdown $netDev }