Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Nov 2021 15:43:15 GMT
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 631607ac2965 - main - t_mlock.c: Remove null_errno, it is write-only
Message-ID:  <202111291543.1ATFhFa4065975@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=631607ac2965e8c6dcc0f21effc9b36fcb530558

commit 631607ac2965e8c6dcc0f21effc9b36fcb530558
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2021-11-28 03:28:29 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2021-11-29 15:39:51 +0000

    t_mlock.c: Remove null_errno, it is write-only
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
---
 contrib/netbsd-tests/lib/libc/sys/t_mlock.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/contrib/netbsd-tests/lib/libc/sys/t_mlock.c b/contrib/netbsd-tests/lib/libc/sys/t_mlock.c
index 61085f35cc21..d9ffbe366a04 100644
--- a/contrib/netbsd-tests/lib/libc/sys/t_mlock.c
+++ b/contrib/netbsd-tests/lib/libc/sys/t_mlock.c
@@ -106,14 +106,9 @@ ATF_TC_BODY(mlock_err, tc)
 #if !defined(__aarch64__) && !defined(__riscv)
 	void *invalid_ptr;
 #endif
-	int null_errno = ENOMEM;	/* error expected for NULL */
 	void *buf;
 
 #ifdef __FreeBSD__
-#ifdef VM_MIN_ADDRESS
-	if ((uintptr_t)VM_MIN_ADDRESS > 0)
-		null_errno = EINVAL;	/* NULL is not inside user VM */
-#endif
 	/* Set max_wired really really high to avoid EAGAIN */
 	set_vm_max_wired(INT_MAX);
 #else
@@ -124,9 +119,6 @@ ATF_TC_BODY(mlock_err, tc)
 	 */
 	errno = 0;
 	ATF_REQUIRE_ERRNO(ENOMEM, mlock(NULL, page) == -1);
-
-	if (vmin > 0)
-		null_errno = EINVAL;	/* NULL is not inside user VM */
 #endif
 
 	errno = 0;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202111291543.1ATFhFa4065975>