Skip to content

Commit b92f255

Browse files
committed
daemon: replace EAGAIN with EWOULDBLOCK
EWOULDBLOCK is specifically for non-blocking I/O, they just happen to be the same on Linux, don't rely on this.
1 parent 20dbb5c commit b92f255

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

daemon/pipe.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ size_t HopperPipe::write_pipe(void *src, size_t len) {
7171
ssize_t res = write(m_fd, reinterpret_cast<char *>(src) + done_len,
7272
len - done_len);
7373

74-
if (res == -1 && (errno == EAGAIN || errno == EINTR))
74+
if (res == -1 && (errno == EWOULDBLOCK || errno == EINTR))
7575
return done_len;
7676
else if (res == -1) {
7777
perror("write");
@@ -97,7 +97,7 @@ size_t HopperPipe::read_pipe(void *dst, size_t len) {
9797
ssize_t res = read(m_fd, reinterpret_cast<char *>(dst) + done_len,
9898
len - done_len);
9999

100-
if (res == -1 && (errno == EAGAIN || errno == EINTR))
100+
if (res == -1 && (errno == EWOULDBLOCK || errno == EINTR))
101101
return done_len;
102102
else if (res == -1) {
103103
perror("read");

0 commit comments

Comments
 (0)