diff options
| author | Gu Bin <gubin@cmss.chinamobile.com> | 2026-11-13 11:57:22 +0800 |
|---|---|---|
| committer | Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> | 2026-11-17 09:19:26 +0100 |
| commit | 845dbb71d620c8f76ed63fa2cd25008194ad3426 (patch) | |
| tree | 3df51f95193b4352962993ef747732ceb1cd0cee /tools/perf/scripts/python | |
| parent | 3e68810e7c109ae4cc23541f36a1a9fc8ed65700 (diff) | |
tools: gpio: gpio-watch: do not clobber errno on read error
gpio-watch reads line change events from a gpiochip character device
and reports a read() error or short read with perror(), which prints
strerror(errno). If read() fails, say with EINTR, the inner
if (rd != sizeof(chg))
errno = EIO;
replaces the real errno with EIO, so the message always reports
"Input/output error" instead of the actual cause.
Only synthesize EIO for short reads (rd >= 0), keeping the errno
that read() set when it failed.
Fixes: 33f0c47b8fb4 ("tools: gpio: implement gpio-watch")
Signed-off-by: Gu Bin <gubin@cmss.chinamobile.com>
Link: https://patch.msgid.link/20261113035723.2215-1-gubin@cmss.chinamobile.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
