[libcamera-devel] [PATCH] libcamera: process: fix error checking
Paul Elder
paul.elder at ideasonboard.com
Fri Jul 12 10:50:57 CEST 2019
The return value of a read() call is mistakenly checked for nonzero
rather than less than zero. Fix this.
Fixes: df23ab95f3d7 ("libcamera: process: fix compilation on Chromium OS")
Signed-off-by: Paul Elder <paul.elder at ideasonboard.com>
---
src/libcamera/process.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/libcamera/process.cpp b/src/libcamera/process.cpp
index aee3373..6c41da2 100644
--- a/src/libcamera/process.cpp
+++ b/src/libcamera/process.cpp
@@ -87,7 +87,8 @@ void sigact(int signal, siginfo_t *info, void *ucontext)
void ProcessManager::sighandler(EventNotifier *notifier)
{
char data;
- if (read(pipe_[0], &data, sizeof(data))) {
+ ssize_t ret = read(pipe_[0], &data, sizeof(data));
+ if (ret < 0) {
LOG(Process, Error)
<< "Failed to read byte from signal handler pipe";
return;
--
2.20.1
More information about the libcamera-devel
mailing list