fix: handle EINTR correctly in get_cpu_mask_from_sysfs master
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 2 May 2024 14:44:36 +0000 (10:44 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 2 May 2024 14:44:36 +0000 (10:44 -0400)
commit3b3400ec5e9f7a84918300546d937fcfeacd7aa3
tree3667dfac2a9562cf16d962dde624e4c93641ec8a
parent5e523511334fce944aeedcd5c5c8d4d1a291f631
fix: handle EINTR correctly in get_cpu_mask_from_sysfs

If the read() in get_cpu_mask_from_sysfs() fails with EINTR, the code is
supposed to retry, but the while loop condition has (bytes_read > 0),
which is false when read() fails with EINTR. The result is that the code
exits the loop, having only read part of the string.

Use (bytes_read != 0) in the while loop condition instead, since the
(bytes_read < 0) case is already handled in the loop.

Original fix in liburcu from Benjamin Marzinski <bmarzins@redhat.com>:

  commit 9922f33e2986 ("fix: handle EINTR correctly in get_cpu_mask_from_sysfs")

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
src/smp.c
This page took 0.023495 seconds and 4 git commands to generate.