From nobody Mon Dec 20 00:38:12 2021 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 8263F18F0816; Mon, 20 Dec 2021 00:38: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JHLKd71HZz3rLf; Mon, 20 Dec 2021 00:38:13 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 F20524C02; Mon, 20 Dec 2021 00:38:12 +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 1BK0cCg3060003; Mon, 20 Dec 2021 00:38:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BK0cCWL060002; Mon, 20 Dec 2021 00:38:12 GMT (envelope-from git) Date: Mon, 20 Dec 2021 00:38:12 GMT Message-Id: <202112200038.1BK0cCWL060002@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: ed21083462a6 - stable/13 - swapon(8): adapt to the new swapoff(2) interface 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ed21083462a66d6d3dd4daa8515333ca42a0290d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1639960694; 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=s++C9zdV2aYUihge7xrdhDhrmKazuEPM4nI6kMorrTw=; b=DdXHRKvHB9hBP+TsqbZI2SA9YGMJAH6sv+LSCRsn/uaro5uUxmu6cnB77MEqjUlQh/1cXm raeW6WBFXSZHpdenQka4cb7wVthFOEx6NSqGDb70k8cy0V3ca1Ljf6XJtV90bi2VrH3R6a qMxWGTZaDBbBmBSrh9h7mqsTi4beIdYmk8aW/flxfQsszK0AsN8bIQeC3gIQtGBfTCwjiN g9hszK2c27uE58iPJPL+wRDNC4HtwrMQFiUc3HhLahd+mns31Z8RfiL+oZVN7q6fWCXs98 NtgFComEDoyrnTBkuKPAVRiU6i7uw1dJTfo4wJ3Kgsc9qnwndtfR3guSb/TsAA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639960694; a=rsa-sha256; cv=none; b=q4a4n3TPA9BSBrB2KwwodHbtHcvzYn16EaMRgT4auROcKlFoT7i3LeMgwb1d/lKOWWzhZ0 /ePiL3BzglFsJPBXDZwGTTTATF10rWqDkXJbv2uTx2t+diX4olPmw8R1RVol/xIc9B34Ft JSj1yTgZ8plvjvYS61L/QC/yy3uZViXI0KWMBfRswx26TaaK8yihmHZ1/7/n/Y51R5Hli0 Tu0/a6mlFjXFyCIVb0deMco5dAK9CBynSI0hmTDnTGZFIGhRkd8hO3IRlYladQY2gKHsdk lbnvKdf91nWm0Ybsi5dWIHNWjXs27nYP3uG1pFELNN8aubJM/IfIZ8IXjL8WZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ed21083462a66d6d3dd4daa8515333ca42a0290d commit ed21083462a66d6d3dd4daa8515333ca42a0290d Author: Konstantin Belousov AuthorDate: 2021-12-08 21:05:49 +0000 Commit: Konstantin Belousov CommitDate: 2021-12-20 00:29:11 +0000 swapon(8): adapt to the new swapoff(2) interface (cherry picked from commit b49b6e0f95c89f8dcb5898424c360b46019254b4) --- sbin/swapon/swapon.c | 10 ++-------- tests/sys/audit/administrative.c | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/sbin/swapon/swapon.c b/sbin/swapon/swapon.c index d644d99e7913..4daa6e8b17ee 100644 --- a/sbin/swapon/swapon.c +++ b/sbin/swapon/swapon.c @@ -789,18 +789,12 @@ swapon_trim(const char *name) static const char * swap_on_off_sfile(const char *name, int doingall) { - struct swapoff_new_args sa; int error; if (which_prog == SWAPON) error = Eflag ? swapon_trim(name) : swapon(name); - else { /* SWAPOFF */ - bzero(&sa, sizeof(sa)); - sa.name = name; - if (fflag) - sa.flags |= SWAPOFF_FORCE; - error = swapoff((const char *)&sa); - } + else /* SWAPOFF */ + error = swapoff(name, fflag ? SWAPOFF_FORCE : 0); if (error == -1) { switch (errno) { diff --git a/tests/sys/audit/administrative.c b/tests/sys/audit/administrative.c index d75f6147cdf4..159e7c14e031 100644 --- a/tests/sys/audit/administrative.c +++ b/tests/sys/audit/administrative.c @@ -1605,7 +1605,7 @@ ATF_TC_BODY(swapoff_failure, tc) FILE *pipefd = setup(fds, auclass); /* Failure reason: Block device required */ - ATF_REQUIRE_EQ(-1, swapoff(path)); + ATF_REQUIRE_EQ(-1, swapoff(path, 0)); check_audit(fds, adregex, pipefd); }