From nobody Sat Oct 12 18:30:15 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 4XQsVb47wtz5Ynfk; Sat, 12 Oct 2024 18:30:15 +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 4XQsVb2jPqz4Dfc; Sat, 12 Oct 2024 18:30:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728757815; 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=evHBiyx9qvJ5AxXG0aJaF6/vUR9Kqm1SxTEfKcF+NgE=; b=Ye0fd2nNBMJPUc3rsVqdq1XvyVjkkvpBICNG1j1qF00RI6HHmFNMRv+unjuAE0Pr2UPuYW a1tYMXm5pFBn9J3fSfU4oVta8wFyV927hc+VVf43KwMhfqSxoJoXCGwQ78+HfBTuJeSv5W Hj3OHgL/GqYsRmpnREe2OJlpm70ER9/FbWCwOgoTJ9wCIbkpD1p7G+2WvJGE68TMt4tu28 SNtq4gglQxzowPUR/bv2O6GhC2ul4cH0b8JCczcvbw7nxW1ItlwqqyqrhPfqSxcFeWJ5rN jo9Aa2F9ExDLj9hR7UkKdh+azAS5ZO4jIeYdC7dGDh0xp2VnP+l683grLD+X9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728757815; 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=evHBiyx9qvJ5AxXG0aJaF6/vUR9Kqm1SxTEfKcF+NgE=; b=Cz0uiuv4l8yvkbCeZxAQpLSOsP4J/a8JDBNGHe03u+VJTzWs22N0mIhmp+mVyqoy6UAD9M 3mFNZCtNOa/HRxuwT6t1Uw55gQZUNUNlTida5+FL4F4x/G8CcbQgVKzquhZ24oYSE4Bvgr ByPMV18P1IZsNv/Z3nAY8yuYyuIEl1DCjwDn++/NAraHF05utS5F1r+Y2tgpSbxkvenUFI +tMGo766bmzzqC6Acdce9s14UDI+Jue2c8lUxgpqd6Ca2V11+YujV6D0kcikk2ewy/7erS YqgqEs7jl0U3qKMlu7WuE2vaoK+VXGKVhWSzVSHLXXA4bVeffYrmnp3vrmO0NA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728757815; a=rsa-sha256; cv=none; b=BPtqHqGmAw18fiK9LA7pJ6qL1XWRlw8UaVRl0WnaHkeIwv3McfeO44qu/fWhIwSn7cHenm WftR3N2UvjsXYha98yD9PCpwmTx3nNFupueYz9Zfm4bxhbjEBJqQpT0unWx3q0WYMoaU62 iLipni/9+YOEzgCUXDE91Ss+wFII/R6jbJVZhFzbseS5GMF7Lk+HzamPhBFsQ1IyOYw8WH yC4FOxZ1ti4coiM4oRNHPlh4+/jIa4HWPcMQaeGlH0IitJE4mYjzHcmjVS+vswaFJeRnrn /or68dMOzsnBQhSUE9zCXJMefHFkkcn9AxD2O2WS4pcbxEIrExf0rwkYrKo73g== 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 4XQsVb1mk1zLgD; Sat, 12 Oct 2024 18:30:15 +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 49CIUFO9090515; Sat, 12 Oct 2024 18:30:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49CIUFGw090509; Sat, 12 Oct 2024 18:30:15 GMT (envelope-from git) Date: Sat, 12 Oct 2024 18:30:15 GMT Message-Id: <202410121830.49CIUFGw090509@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: 54ff53d89015 - main - ndp(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: 54ff53d89015cd4338bcca6060fe2877309f6db3 Auto-Submitted: auto-generated The branch main has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=54ff53d89015cd4338bcca6060fe2877309f6db3 commit 54ff53d89015cd4338bcca6060fe2877309f6db3 Author: Yan-Hao Wang AuthorDate: 2024-10-12 14:47:51 +0000 Commit: Li-Wen Hsu CommitDate: 2024-10-12 18:21:46 +0000 ndp(8): Complete libxo transition Reviewed by: des MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D41417 --- usr.sbin/ndp/ndp.c | 20 ++++++++++---------- usr.sbin/ndp/ndp_netlink.c | 6 ++---- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/usr.sbin/ndp/ndp.c b/usr.sbin/ndp/ndp.c index 7c7bc60451c8..a023a7d0ad77 100644 --- a/usr.sbin/ndp/ndp.c +++ b/usr.sbin/ndp/ndp.c @@ -103,7 +103,6 @@ #include #include #include -#include #include #include #include @@ -350,7 +349,8 @@ main(int argc, char **argv) break; } xo_close_container("ndp"); - xo_finish(); + if (xo_finish() < 0) + xo_err(1, "stdout"); return (ret); } @@ -921,16 +921,16 @@ ndp_ether_aton(char *a, u_char *n) static void usage(void) { - printf("usage: ndp [-nt] hostname\n"); - printf(" ndp [-nt] -a | -c | -p | -r | -H | -P | -R\n"); - printf(" ndp [-nt] -A wait\n"); - printf(" ndp [-nt] -d hostname\n"); - printf(" ndp [-nt] -f filename\n"); - printf(" ndp [-nt] -i interface [flags...]\n"); + xo_error("usage: ndp [-nt] hostname\n"); + xo_error(" ndp [-nt] -a | -c | -p | -r | -H | -P | -R\n"); + xo_error(" ndp [-nt] -A wait\n"); + xo_error(" ndp [-nt] -d hostname\n"); + xo_error(" ndp [-nt] -f filename\n"); + xo_error(" ndp [-nt] -i interface [flags...]\n"); #ifdef SIOCSDEFIFACE_IN6 - printf(" ndp [-nt] -I [interface|delete]\n"); + xo_error(" ndp [-nt] -I [interface|delete]\n"); #endif - printf(" ndp [-nt] -s nodename etheraddr [temp] [proxy]\n"); + xo_error(" ndp [-nt] -s nodename etheraddr [temp] [proxy]\n"); exit(1); } diff --git a/usr.sbin/ndp/ndp_netlink.c b/usr.sbin/ndp/ndp_netlink.c index bafa9f2a143d..546057e5e552 100644 --- a/usr.sbin/ndp/ndp_netlink.c +++ b/usr.sbin/ndp/ndp_netlink.c @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -42,7 +41,6 @@ #include #include -#include #include "ndp.h" #define RTF_ANNOUNCE RTF_PROTO2 @@ -56,12 +54,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