fix: handle EINTR correctly in get_cpu_mask_from_sysfs master
authorBenjamin Marzinski via lttng-dev <lttng-dev@lists.lttng.org>
Wed, 1 May 2024 23:42:41 +0000 (19:42 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 2 May 2024 14:41:24 +0000 (10:41 -0400)
commit9922f33e29869ac23296a857fd6a9f813d24ad4a
tree0224249b29b4b08779abdd317bce89c17bd6abc9
parent02a024dc4cbadddb8700aca7b3f6cf27f69e8f3f
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.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I565030d4625ae199cabc4c2ab5eb8ac49ea4dfcb
src/compat-smp.h
This page took 0.027244 seconds and 4 git commands to generate.