diff options
| author | Yuqian Yang <crupest@crupest.life> | 2025-09-04 22:59:47 +0800 |
|---|---|---|
| committer | Yuqian Yang <crupest@crupest.life> | 2025-09-04 22:59:47 +0800 |
| commit | 4c3098be1c5abaed610b8f10216d59829fc107ce (patch) | |
| tree | 2f1367f1e6ed35ad831bba5888a6dfdbfa72a91b /src/base | |
| parent | fdddc7f4a8884a8481dc71c0f34b8775659ba236 (diff) | |
| download | cru-4c3098be1c5abaed610b8f10216d59829fc107ce.tar.gz cru-4c3098be1c5abaed610b8f10216d59829fc107ce.tar.bz2 cru-4c3098be1c5abaed610b8f10216d59829fc107ce.zip | |
Fix SetFileDescriptorFlags (by adding testing).
Diffstat (limited to 'src/base')
| -rw-r--r-- | src/base/platform/unix/UnixFile.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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."); } } |
