From nobody Thu Feb 09 20:40:40 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PCTK50Vvhz3ndfy; Thu, 9 Feb 2023 20:40:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PCTK501trz3wmR; Thu, 9 Feb 2023 20:40:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675975241; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JYEti8UwoiB/U1Yyj2cZN1O9CRXXYQMc8932Pe6Id/Y=; b=pbx428d/YuW+2Px+nFw4aSQWtjOUmRpUQwZgJNCdBZgsQFd2VSCRHhcxtheIEHVEMWCEzb ooRc3HBCFkksEHSiP1/VnfI2H0uIpJTksyBagWcm8mqXlrTmyCY5c2xFVQZqRWvg37s6OU c42ardDIM4hIFXYWhNel/3hHFv5xLiBTGbs4Zznqi7t3HvFsEKkkn1Q9leYb9PG3XAC2Z5 xFhdRLNmgbkxukBfABw1oT/Zhw+PprzVXA0ej3a2MqWuCc2Vwjr1V3qtc2wc2ojH39Vk7l 37Wbl3eTesUc3MOPomUcs6sbMZWUmga/zRHSFhrPl5d2anAJ2b/l3+eh6eRrXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675975241; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JYEti8UwoiB/U1Yyj2cZN1O9CRXXYQMc8932Pe6Id/Y=; b=vdSvbyfGn2bdNVif5TVNAUP2rc2kdCVPhhffds5nMzL+Micnq0yV2dy4LPhEvl5mcYDFk9 QSJs/cIe3dr2+thKh2suSYWH9oO1jZUpg4by6RIEf/Y5vy/VcybADBWG/iYrYzUNikZk7V B8vp+1yG0yHVuHbKJWUp6KVBIpOpwzJ5EzmVgDy8rdGZjNcukW8URQmxhB5JonmEh4riHY sgSDeg/hTjYqdEGlFyoIKWtNwbjXhdt81vnDg6DTTTNQWMzpmKyGMAiX4MKuh+k4RHvfl1 0zFQQ1pTBo55bNBoX9hRjEK6nMHGNrZja5B6pNaAEUu/rmbKPioXGPaeq1lP8Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675975241; a=rsa-sha256; cv=none; b=Py7dISpri255ZoaRc6yvYijgOfBQPwsQMO32220Hbxr1abXswZFNi/cdQcaxhbNbs784Mr gBZkfKgrKVeH2lNmS7rdu6G5Sev+Cqt62BbQ9S5B1VFfypTuTNk9s1W/3Dpk6606/8f7IL LlRXEShv0iHxYcUeaaItaEp0CRhIYt1lOh01dohcV6hNlc9AiSRCMySLWUUFJ1wbIKZKRu B13n1T7YIRH1zXMYfV0BEIfaA2AQwGhE7jT8dzqFasYS4zmQFf604UzUVC2S1j5l4mW1SH tTSSJa3vEgEkN93q2M9t4Y+xr+2uPqo8cMxWDbD/iO77SuWB8vKDfspTiU8ZbA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PCTK46B0WzrXJ; Thu, 9 Feb 2023 20:40:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 319Keesh093882; Thu, 9 Feb 2023 20:40:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 319Keel2093881; Thu, 9 Feb 2023 20:40:40 GMT (envelope-from git) Date: Thu, 9 Feb 2023 20:40:40 GMT Message-Id: <202302092040.319Keel2093881@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Dag-Erling=20Sm=C3=B8rgrav?= Subject: git: 1b11dd2108ca - stable/13 - df: Return non-zero status on write failure. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1b11dd2108ca90a707c7f8976f409bf249509c94 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=1b11dd2108ca90a707c7f8976f409bf249509c94 commit 1b11dd2108ca90a707c7f8976f409bf249509c94 Author: Dag-Erling Smørgrav AuthorDate: 2023-01-17 13:40:05 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-02-09 20:32:56 +0000 df: Return non-zero status on write failure. While here, complete the libxo conversion and switch return value to standard constants. MFC after: 1 week Sponsored by: Klara, Inc. Differential revision: https://reviews.freebsd.org/D38097 (cherry picked from commit c968598479917f52022b86d0089a9835ddcf2799) --- bin/df/df.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/bin/df/df.c b/bin/df/df.c index 627d8b1c861d..9f7588a68d4f 100644 --- a/bin/df/df.c +++ b/bin/df/df.c @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -204,7 +203,7 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; - rv = 0; + rv = EXIT_SUCCESS; if (!*argv) { /* everything (modulo -t) */ mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); @@ -226,14 +225,14 @@ main(int argc, char *argv[]) if (stat(*argv, &stbuf) < 0) { if ((mntpt = getmntpt(*argv)) == NULL) { xo_warn("%s", *argv); - rv = 1; + rv = EXIT_FAILURE; continue; } } else if (S_ISCHR(stbuf.st_mode)) { mntpt = getmntpt(*argv); if (mntpt == NULL) { xo_warnx("%s: not mounted", *argv); - rv = 1; + rv = EXIT_FAILURE; continue; } } else { @@ -246,7 +245,7 @@ main(int argc, char *argv[]) */ if (statfs(mntpt, &statfsbuf) < 0) { xo_warn("%s", mntpt); - rv = 1; + rv = EXIT_FAILURE; continue; } @@ -257,7 +256,7 @@ main(int argc, char *argv[]) * we've been given (-l, -t, etc.). */ if (checkvfsselected(statfsbuf.f_fstypename) != 0) { - rv = 1; + rv = EXIT_FAILURE; continue; } @@ -286,7 +285,8 @@ main(int argc, char *argv[]) prtstat(&totalbuf, &maxwidths); xo_close_container("storage-system-information"); - xo_finish(); + if (xo_finish() < 0) + rv = EXIT_FAILURE; exit(rv); } @@ -322,7 +322,7 @@ makevfslist(char *fslist, int *skip) if (*nextcp == ',') i++; if ((av = malloc((size_t)(i + 2) * sizeof(char *))) == NULL) { - warnx("malloc failed"); + xo_warnx("malloc failed"); return (NULL); } nextcp = fslist;