From owner-svn-src-all@freebsd.org Sun Feb 18 20:49:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B3F2F02E93; Sun, 18 Feb 2018 20:49:44 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D27316AD01; Sun, 18 Feb 2018 20:49:43 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C8FCC1114E; Sun, 18 Feb 2018 20:49:43 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1IKnhgG076403; Sun, 18 Feb 2018 20:49:43 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1IKnhLv076402; Sun, 18 Feb 2018 20:49:43 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201802182049.w1IKnhLv076402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Sun, 18 Feb 2018 20:49:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329530 - stable/11/bin/df X-SVN-Group: stable-11 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/11/bin/df X-SVN-Commit-Revision: 329530 X-SVN-Commit-Repository: base 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.25 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 Feb 2018 20:49:44 -0000 Author: brooks Date: Sun Feb 18 20:49:43 2018 New Revision: 329530 URL: https://svnweb.freebsd.org/changeset/base/329530 Log: MFC r329092: Add a deprecation warning when using the feature which mounts devices to see how much space it on them. Adjust MOUNT_CHAR_DEVS to allow the free space of already mounted devices to be displayed and report an appropriate error if the device isn't mounted. Reviewed by: cem Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D8801 Modified: stable/11/bin/df/df.c Directory Properties: stable/11/ (props changed) Modified: stable/11/bin/df/df.c ============================================================================== --- stable/11/bin/df/df.c Sun Feb 18 20:08:35 2018 (r329529) +++ stable/11/bin/df/df.c Sun Feb 18 20:49:43 2018 (r329530) @@ -249,9 +249,11 @@ main(int argc, char *argv[]) rv = 1; continue; } -#ifdef MOUNT_CHAR_DEVS } else if (S_ISCHR(stbuf.st_mode)) { if ((mntpt = getmntpt(*argv)) == NULL) { +#ifdef MOUNT_CHAR_DEVS + xo_warnx( + "df on unmounted devices is deprecated"); mdev.fspec = *argv; mntpath = strdup("/tmp/df.XXXXXX"); if (mntpath == NULL) { @@ -300,8 +302,12 @@ main(int argc, char *argv[]) (void)rmdir(mntpt); free(mntpath); continue; - } +#else + xo_warnx("%s: not mounted", *argv); + rv = 1; + continue; #endif + } } else mntpt = *argv;