errno should be used to evaluate error code
This commit is contained in:
parent
22f8cc687f
commit
ad7fc183d1
|
@ -1466,7 +1466,7 @@ int Client::write_udp(const sockaddr *addr, socklen_t addrlen,
|
||||||
|
|
||||||
auto nwrite = sendmsg(fd, &msg, 0);
|
auto nwrite = sendmsg(fd, &msg, 0);
|
||||||
if (nwrite < 0) {
|
if (nwrite < 0) {
|
||||||
if (nwrite == EAGAIN || nwrite == EWOULDBLOCK) {
|
if (errno == EAGAIN || errno == EWOULDBLOCK) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue