From 4c3098be1c5abaed610b8f10216d59829fc107ce Mon Sep 17 00:00:00 2001 From: Yuqian Yang Date: Thu, 4 Sep 2025 22:59:47 +0800 Subject: Fix SetFileDescriptorFlags (by adding testing). --- src/base/platform/unix/UnixFile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/base/platform/unix/UnixFile.cpp b/src/base/platform/unix/UnixFile.cpp index 763161ce..6d2dea89 100644 --- a/src/base/platform/unix/UnixFile.cpp +++ b/src/base/platform/unix/UnixFile.cpp @@ -98,7 +98,7 @@ ssize_t UnixFileDescriptor::Read(void* buffer, size_t size) { void UnixFileDescriptor::SetFileDescriptorFlags(int flags) { EnsureValid(); - if (::fcntl(GetValue(), F_SETFL, flags) != -1) { + if (::fcntl(GetValue(), F_SETFL, flags) == -1) { throw ErrnoException("Failed to set flags on file descriptor."); } } -- cgit v1.2.3