]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix asserts in testcases close_range, bug514094 and readlinkat_self.
authorMark Wielaard <mark@klomp.org>
Tue, 3 Feb 2026 18:28:46 +0000 (19:28 +0100)
committerMark Wielaard <mark@klomp.org>
Tue, 3 Feb 2026 18:34:00 +0000 (19:34 +0100)
These tests did an assert (errno = EFAULT) instead of an assert on
errno == EFAULT. close_range was also using an valid flag 2
(CLOSE_RANGE_UNSHARE) instead of a bad one.

memcheck/tests/close_range.c
none/tests/bug514094.c
none/tests/linux/readlinkat_self.c

index 5c21e7f42b6a7f70aa5100697b4ad7ce6e16c873..93e840072fd3a119f6d9c2c073a29ac50d53824e 100644 (file)
@@ -60,13 +60,13 @@ int main(void)
    
    errno = 0;
    // bad flag
-   close_range(fd1, fd3, 2);
-   assert(errno = EINVAL);
+   close_range(fd1, fd3, 231);
+   assert(errno == EINVAL);
    
    errno = 0;
    // wrong order
    close_range(fd3, fd1, 0);
-   assert(errno = EINVAL);
+   assert(errno == EINVAL);
    
    errno = 0;
    getrlimit(RLIMIT_NOFILE, &rl);
index a62a6406b72271472bc08ff74d9015ed5af60f5f..6a45f0949395a689c172ee9aaf934187c1bdd88b 100644 (file)
@@ -43,6 +43,6 @@ int main(int argc, char** argv)
    ret = readlink("/proc/self/exe", (char*)1, 100);
 #endif
    assert(ret == -1);
-   assert(errno = EFAULT);
+   assert(errno == EFAULT);
 }
 
index 586581a0d9667ae4ec369cc4bf4f91fbb3bf1a22..ded4c796b9d493db7ecb890fd5ea06916d6e5c80 100644 (file)
@@ -29,6 +29,6 @@ int main(int argc, char** argv)
 
    ret = readlinkat(101, "/proc/self/exe", (char*)1, 100);
    assert(ret == -1);
-   assert(errno = EFAULT);
+   assert(errno == EFAULT);
 }