From nobody Sat Oct 12 18:30:14 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 4XQsVZ2LT5z5YnSx; Sat, 12 Oct 2024 18:30:14 +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 4XQsVZ1mPJz4Dbm; Sat, 12 Oct 2024 18:30:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728757814; 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=DPUafvtrYVPmDH1tOXAJfrhkj8QaC8bA1GqVEsOaaTE=; b=DJHXRCOKVkLvc2wp1EGlOrNDTyKPmJrQz6YwohI075HXO29Aba9+GQGB/FFk9EBxtL871B virLdnNBzXOk9YWIgx7xKwgee3bW6NrI1/XHPgc6U+W2SfRy5ae7h7ke6NqBcSbGG/Sd27 DKY8r2CGeVHKjKOv3pQRjGCE30HVjQ4DrtFb3PhpQ9W24xQS77H99JnEQcSMMKvy3Vbv06 P6/gdcngwMhkb3JebU7Z8KW3ys0/uvYkBhTRzUqATLVeSWWyeyN6Wdpdd1NR4clAFjAWtc InkM0kSNd5W0FLAeMM58skmjOec9aJBOzBEkaIYBSS3RDr6gMiIB1ThRTAiwoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728757814; 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=DPUafvtrYVPmDH1tOXAJfrhkj8QaC8bA1GqVEsOaaTE=; b=KXFUunoLk4OvH6iceDrJb9eOFJKbZJmyoRc6ccdL/aOO4xy5reciFRFGtdGZK0J+TVl8eL mLeLH6bz+amjTwy7kE4cg3USbJOYD42sqoDzbgKKMi4gS6WkDtWlQ6Ptp5EgWcifnnwZzj ldMSVzYcU4k6mY5cg1SHxKlQKbY1cr9MUdQ5IBS50r7/yjTMin6lx/stulCBKES4mSLy57 eucESM7rfHvpSbXMV2XW9xSvF4qbkQEW4FGDS+DfyRsmtvoKzJccs1ASueXDJkNtRjY72n 7BNOVWuC1XXEDncP1FCS3q43X6EoZUJLY5MQ9JtJhWNc7rm01X2HGe+bxPtotQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728757814; a=rsa-sha256; cv=none; b=ZCJ6PWah4IjKkhUJSC/x/lQsfKhSL9lxp9YI5vmfwwPuVt5iiOzPROOWa3aMvmD5B5FmEC PCYgriAW96ZiYSZOmZlTOAtw015xFbFXLticARlYRJG61kuI13djER0h0FgQe0989PQ0lG r0R/D/zuQ2LvSMAI5IRA9ScOkLVp9kzhqXKYFio/GsoOcBbSMoNzD8oCgUrkJ1js9+bgQC xjzT6RSZ2qnPXIV6D98vUMeKYym9nY7lj5MH+Qo/SdTqsjOPDcby+ThgXDItqCIgEpTlPZ WBvguWWcTZ2MLtcvaNRIiE/oMut6xYAh8vDQVZu6yG3USl6Rzza6f4SRmZRLWw== 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 4XQsVZ1MFQzLSK; Sat, 12 Oct 2024 18:30:14 +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 49CIUE56089817; Sat, 12 Oct 2024 18:30:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49CIUEcc089812; Sat, 12 Oct 2024 18:30:14 GMT (envelope-from git) Date: Sat, 12 Oct 2024 18:30:14 GMT Message-Id: <202410121830.49CIUEcc089812@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: 417842f90861 - main - arp(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: 417842f908619336dd4c739a92c326ade2c35770 Auto-Submitted: auto-generated The branch main has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=417842f908619336dd4c739a92c326ade2c35770 commit 417842f908619336dd4c739a92c326ade2c35770 Author: Yan-Hao Wang AuthorDate: 2024-10-12 14:38:45 +0000 Commit: Li-Wen Hsu CommitDate: 2024-10-12 18:21:45 +0000 arp(8): Complete libxo transition Reviewed by: des MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D41408 --- usr.sbin/arp/arp.c | 11 ++++++----- usr.sbin/arp/arp_netlink.c | 5 ++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/usr.sbin/arp/arp.c b/usr.sbin/arp/arp.c index 8cd18d875820..ee4236b5299b 100644 --- a/usr.sbin/arp/arp.c +++ b/usr.sbin/arp/arp.c @@ -55,7 +55,6 @@ #include #include -#include #include #include #include @@ -169,7 +168,8 @@ main(int argc, char *argv[]) xo_close_list("arp-cache"); xo_close_container("arp"); - xo_finish(); + if (xo_finish() < 0) + xo_err(1, "stdout"); } else { if (argc != 1) usage(); @@ -206,7 +206,7 @@ main(int argc, char *argv[]) if (ifnameindex != NULL) if_freenameindex(ifnameindex); - return (rtn); + exit(rtn); } /* @@ -446,7 +446,8 @@ get(char *host) xo_close_list("arp-cache"); xo_close_container("arp"); - xo_finish(); + if (xo_finish() < 0) + xo_err(1, "stdout"); return (found == 0); } @@ -723,7 +724,7 @@ nuke_entries(uint32_t ifindex, struct in_addr addr) static void usage(void) { - fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n", + xo_error("%s\n%s\n%s\n%s\n%s\n%s\n%s\n", "usage: arp [-n] [-i interface] hostname", " arp [-n] [-i interface] -a", " arp -d hostname [pub]", diff --git a/usr.sbin/arp/arp_netlink.c b/usr.sbin/arp/arp_netlink.c index 24e01126044b..db1ef775dea2 100644 --- a/usr.sbin/arp/arp_netlink.c +++ b/usr.sbin/arp/arp_netlink.c @@ -2,7 +2,6 @@ #include #include #include -#include #include #include @@ -43,12 +42,12 @@ nl_init_socket(struct snl_state *ss) if (modfind("netlink") == -1 && errno == ENOENT) { /* Try to load */ if (kldload("netlink") == -1) - err(1, "netlink is not loaded and load attempt failed"); + xo_err(1, "netlink is not loaded and load attempt failed"); if (snl_init(ss, NETLINK_ROUTE)) return; } - err(1, "unable to open netlink socket"); + xo_err(1, "unable to open netlink socket"); } static bool