errno should be used to evaluate error code

This commit is contained in:
Tatsuhiro Tsujikawa 2022-06-22 23:58:30 +09:00
parent 22f8cc687f
commit ad7fc183d1
1 changed files with 1 additions and 1 deletions

View File

@ -1466,7 +1466,7 @@ int Client::write_udp(const sockaddr *addr, socklen_t addrlen,
auto nwrite = sendmsg(fd, &msg, 0);
if (nwrite < 0) {
if (nwrite == EAGAIN || nwrite == EWOULDBLOCK) {
if (errno == EAGAIN || errno == EWOULDBLOCK) {
return 1;
}