summaryrefslogtreecommitdiffstats
path: root/src/shared/barrier.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-11-29 20:07:24 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-11-30 15:06:43 +0100
commit8add30a03cb19e4a2722fa5a0fc08c277aaf67fd (patch)
tree0783689bd605d0ca5420bea9a4e2eadf98da4774 /src/shared/barrier.c
parenterrno-util: introduce ERRNO_IS_TRANSIENT() (diff)
downloadsystemd-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.c5
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))