[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
Wed Jun 26 09:52:25 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:
Convention. I think `UseAfterClose` and the other unit tests that use `ASSERT_ERRNO_` macros should be doing this, too.
https://github.com/llvm/llvm-project/pull/96325
More information about the libc-commits
mailing list