parent
ac6f928ad4
commit
503e5bc507
|
@ -258,6 +258,7 @@ void write(int fd, StringView data)
|
||||||
ssize_t count = (int)data.length();
|
ssize_t count = (int)data.length();
|
||||||
|
|
||||||
int flags = fcntl(fd, F_GETFL, 0);
|
int flags = fcntl(fd, F_GETFL, 0);
|
||||||
|
if (EventManager::has_instance())
|
||||||
fcntl(fd, F_SETFL, flags | O_NONBLOCK);
|
fcntl(fd, F_SETFL, flags | O_NONBLOCK);
|
||||||
auto restore_flags = on_scope_end([&] { fcntl(fd, F_SETFL, flags); });
|
auto restore_flags = on_scope_end([&] { fcntl(fd, F_SETFL, flags); });
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user