diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-11-29 20:07:24 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-11-30 15:06:43 +0100 |
commit | 8add30a03cb19e4a2722fa5a0fc08c277aaf67fd (patch) | |
tree | 0783689bd605d0ca5420bea9a4e2eadf98da4774 /src/shared/barrier.c | |
parent | errno-util: introduce ERRNO_IS_TRANSIENT() (diff) | |
download | systemd-8add30a03cb19e4a2722fa5a0fc08c277aaf67fd.tar.xz systemd-8add30a03cb19e4a2722fa5a0fc08c277aaf67fd.zip |
tree-wide: use ERRNO_IS_TRANSIENT()
Diffstat (limited to 'src/shared/barrier.c')
-rw-r--r-- | src/shared/barrier.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/shared/barrier.c b/src/shared/barrier.c index 87061f55d7..cbe54a60cd 100644 --- a/src/shared/barrier.c +++ b/src/shared/barrier.c @@ -10,6 +10,7 @@ #include <unistd.h> #include "barrier.h" +#include "errno-util.h" #include "fd-util.h" #include "io-util.h" #include "macro.h" @@ -178,7 +179,7 @@ static bool barrier_write(Barrier *b, uint64_t buf) { assert(b->me >= 0); do { len = write(b->me, &buf, sizeof(buf)); - } while (len < 0 && IN_SET(errno, EAGAIN, EINTR)); + } while (len < 0 && ERRNO_IS_TRANSIENT(errno)); if (len != sizeof(buf)) goto error; @@ -230,7 +231,7 @@ static bool barrier_read(Barrier *b, int64_t comp) { /* events on @them signal new data for us */ len = read(b->them, &buf, sizeof(buf)); - if (len < 0 && IN_SET(errno, EAGAIN, EINTR)) + if (len < 0 && ERRNO_IS_TRANSIENT(errno)) continue; if (len != sizeof(buf)) |