From nobody Sat Oct 12 18:30:22 2024 X-Original-To: dev-commits-src-main@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 4XQsVl1nyrz5YnjD; Sat, 12 Oct 2024 18:30:23 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XQsVl0KQ8z4F4f; Sat, 12 Oct 2024 18:30:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728757823; 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=jo5GCSc1nuSefOLJo1ia+MQBPy9CTnD/E1WDDoDEo6s=; b=wV/pja1pYLyf5cq9YG/Ke5GEDsGP1TIw/oSClBOxMWV6ZXUR+Ocep94B7s+PRJ8AExoi97 xj5xQ21AsWfR1SM4ozvXXREvCTDe/lF1wItjES5IqdofLX1FkjQuFhi/HXtK2dc5xA6j9f QV9VgQQDrN+CfNbzmfVbGItyplWA57MmxLHjmedL+va5w1HkQcwpX5hirkzyv5rLz+9ih4 7JzERDPNhP4g+M+7VD9Yn7TBsQxcFs8FeNV+/fMNahtnZvRa7/UzWGLEGvkXnuOpjNJt5u J17ijLZRYWCefL68zr52GiIoG26crlO5jFhIwfUD8lfH8JvAa0trFtf1EoFIxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728757823; 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=jo5GCSc1nuSefOLJo1ia+MQBPy9CTnD/E1WDDoDEo6s=; b=e0Bwh8vyKl1dJpkE6ncfQ7ui1lfD3cuBP1OjeRUX5OzC2J2C5l/Pe1IuMxlBqjP408Jqza SLd1xO/vJiH/ybfoLKLOwhxInR66/bB0RxKiidzdCIIf4+/0Y7I6BSSroWfotOXyzG6Sh6 9Snpxem6ZkUsV4fWrc8s+ljvktrGGQEbaurqmrFu+mNsBgbeEU+FHKYLF3ZMwnsw4r9UMf /rf4r3BKKIQFdcqq6TFqGVy5N3VqkRH9ordP6NC1MXgMe6QHKCE0txq8aZhWKfU/6PnS25 9+izw7x9/0LEDL/hVNA3ffKxylpv9nAOI/9eMF+1UeGrYJn8LRwc5TerRkUk+Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728757823; a=rsa-sha256; cv=none; b=YXRfKieaVtWJlI0QG5sN5J7o6BT/VH7zL80KooxuhtBPS/HVFQ/FQcY+muqj6WXia5e5mN jym2uTh90KfS0b6qjrawMRC93FlCO77UnAOF7nr95u/Gg00PhUAiy78NMyxCfWU3uOY5t/ TM9LCJu/KybwC9W3/QQhmxv56QoClp1dSEbZxAyTV8vi3WLPuj8pWRI5w4yyf3HPolr8gi 7MhWstIZizScjAkmLfM98fWyiaJ+t01Cpr99KJf4pkVtH3/ZQTL66rHuYbMg11BU7mnblA D0/+Wsqo473sxy3tU0G/OQRZT36gMMV/j/JkDEuZRsxz0j1/cRjg2EVjgprOQA== 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 4XQsVk6rcbzLSM; Sat, 12 Oct 2024 18:30:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49CIUMBB092377; Sat, 12 Oct 2024 18:30:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49CIUMSZ092374; Sat, 12 Oct 2024 18:30:22 GMT (envelope-from git) Date: Sat, 12 Oct 2024 18:30:22 GMT Message-Id: <202410121830.49CIUMSZ092374@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Li-Wen Hsu Subject: git: 183e8aa749c1 - main - mount(8): Complete libxo transition List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 183e8aa749c1fe7de44c842542d9e9eadf11b8cb Auto-Submitted: auto-generated The branch main has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=183e8aa749c1fe7de44c842542d9e9eadf11b8cb commit 183e8aa749c1fe7de44c842542d9e9eadf11b8cb Author: Yan-Hao Wang AuthorDate: 2024-10-12 15:18:51 +0000 Commit: Li-Wen Hsu CommitDate: 2024-10-12 18:21:47 +0000 mount(8): Complete libxo transition Reviewed by: des MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D41390 --- sbin/mount/mount.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/sbin/mount/mount.c b/sbin/mount/mount.c index c950574719ad..1b8eceb9a6ed 100644 --- a/sbin/mount/mount.c +++ b/sbin/mount/mount.c @@ -36,7 +36,7 @@ #include #include -#include + #include #include #include @@ -56,7 +56,8 @@ #define EXIT(a) { \ xo_close_container("mount"); \ - xo_finish(); \ + if (xo_finish() < 0) \ + xo_err(EXIT_FAILURE, "stdout"); \ exit(a); \ } @@ -142,7 +143,7 @@ exec_mountprog(const char *name, const char *execname, char *const argv[]) switch (pid = fork()) { case -1: /* Error. */ xo_warn("fork"); - EXIT(1); + EXIT(EXIT_FAILURE); case 0: /* Child. */ /* Go find an executable. */ execvP(execname, _PATH_SYSPATH, argv); @@ -152,7 +153,7 @@ exec_mountprog(const char *name, const char *execname, char *const argv[]) xo_warnx("in path: %s", _PATH_SYSPATH); } } - EXIT(1); + EXIT(EXIT_FAILURE); default: /* Parent. */ if (waitpid(pid, &status, 0) < 0) { xo_warn("waitpid"); @@ -217,7 +218,7 @@ main(int argc, char *argv[]) argc = xo_parse_args(argc, argv); if (argc < 0) - exit(1); + exit(EXIT_FAILURE); xo_open_container("mount"); while ((ch = getopt(argc, argv, "adF:fLlno:prt:uvw")) != -1) @@ -289,7 +290,7 @@ main(int argc, char *argv[]) if ((init_flags & MNT_UPDATE) && (ro == 0)) options = catopt(options, "noro"); - rval = 0; + rval = EXIT_SUCCESS; switch (argc) { case 0: if ((mntsize = getmntinfo(&mntbuf, @@ -320,7 +321,7 @@ main(int argc, char *argv[]) if (mountfs(fs->fs_vfstype, fs->fs_spec, fs->fs_file, init_flags, options, fs->fs_mntops) && !failok) - rval = 1; + rval = EXIT_FAILURE; } } else if (fstab_style) { xo_open_list("fstab"); @@ -441,7 +442,7 @@ main(int argc, char *argv[]) * If the mount was successfully, and done by root, tell mountd the * good news. */ - if (rval == 0 && getuid() == 0) + if (rval == EXIT_SUCCESS && getuid() == 0) restart_mountd(); EXIT(rval); @@ -884,7 +885,7 @@ usage(void) "usage: mount [-adflpruvw] [-F fstab] [-o options] [-t ufs | external_type]", " mount [-dfpruvw] special | node", " mount [-dfpruvw] [-o options] [-t ufs | external_type] special node"); - EXIT(1); + EXIT(EXIT_FAILURE); } void