mirror of
https://github.com/systemd/systemd.git
synced 2024-10-27 10:25:37 +03:00
Add assert in barrier code
This function is not supposed to fail, it only returns a boolean. So add an assert in case anyone calls it without proper initialization of *b.
This commit is contained in:
parent
baa33e79e3
commit
5c687f08ca
@ -197,6 +197,7 @@ static bool barrier_write(Barrier *b, uint64_t buf) {
|
||||
if (barrier_i_aborted(b))
|
||||
return false;
|
||||
|
||||
assert(b->me >= 0);
|
||||
do {
|
||||
len = write(b->me, &buf, sizeof(buf));
|
||||
} while (len < 0 && IN_SET(errno, EAGAIN, EINTR));
|
||||
|
Loading…
Reference in New Issue
Block a user