}
if (k < 0)
- return errno == EAGAIN ? 0 : -errno;
+ return ERRNO_IS_TRANSIENT(errno) ? 0 : -errno;
iovec_advance(b->auth_iovec, &b->auth_index, (size_t) k);
return 1;
uid_t u;
int r;
- /* We don't do any real authentication here. Instead, if
+ /* We don't do any real authentication here. Instead, if
* the owner of this bus wanted authentication they should have
* checked SO_PEERCRED before even creating the bus object. */
} else
handle_cmsg = true;
}
- if (k == -EAGAIN)
- return 0;
- if (k < 0)
+ if (k < 0) {
+ if (ERRNO_IS_TRANSIENT(k))
+ return 0;
return (int) k;
+ }
if (k == 0) {
if (handle_cmsg)
cmsg_close_all(&mh); /* paranoia, we shouldn't have gotten any fds on EOF */
}
if (k < 0)
- return errno == EAGAIN ? 0 : -errno;
+ return ERRNO_IS_TRANSIENT(errno) ? 0 : -errno;
*idx += (size_t) k;
return 1;
} else
handle_cmsg = true;
}
- if (k == -EAGAIN)
- return 0;
- if (k < 0)
+ if (k < 0) {
+ if (ERRNO_IS_TRANSIENT(k))
+ return 0;
return (int) k;
+ }
if (k == 0) {
if (handle_cmsg)
cmsg_close_all(&mh); /* On EOF we shouldn't have gotten an fd, but let's make sure */
buflen = recvmsg(m->sock, &smsg, 0);
if (buflen < 0) {
- if (errno != EINTR)
+ if (ERRNO_IS_TRANSIENT(errno))
log_debug_errno(errno, "sd-device-monitor: Failed to receive message: %m");
return -errno;
}
length = recv(resolve->fds[REQUEST_RECV_FD], &buf, sizeof buf, 0);
if (length < 0) {
- if (errno == EINTR)
+ if (ERRNO_IS_TRANSIENT(errno))
continue;
break;
l = recv(resolve->fds[RESPONSE_RECV_FD], &buf, sizeof buf, 0);
if (l < 0) {
- if (errno == EAGAIN)
+ if (ERRNO_IS_TRANSIENT(errno))
return 0;
return -errno;