[libc-commits] [libc] [libc][fcntl] Simplify the handling of the return value from syscall … (PR #96325)
Nick Desaulniers via libc-commits
libc-commits at lists.llvm.org
Tue Jun 25 10:04:49 PDT 2024
================
@@ -162,4 +163,23 @@ TEST(LlvmLibcFcntlTest, UseAfterClose) {
ASSERT_THAT(LIBC_NAMESPACE::close(fd), Succeeds(0));
ASSERT_EQ(-1, LIBC_NAMESPACE::fcntl(fd, F_GETFL));
ASSERT_ERRNO_EQ(EBADF);
+ LIBC_NAMESPACE::libc_errno = 0;
----------------
nickdesaulniers wrote:
```suggestion
// Clear errno for subsequent unit tests.
LIBC_NAMESPACE::libc_errno = 0;
```
https://github.com/llvm/llvm-project/pull/96325
More information about the libc-commits
mailing list