summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Elder <paul.elder@ideasonboard.com>2019-07-12 17:42:40 +0900
committerPaul Elder <paul.elder@ideasonboard.com>2019-07-12 17:48:30 +0900
commitbfbc25785fcafb0ed2e14a19d2508238594065d3 (patch)
treed4060abc33f8c93fd8f48331a2575373adb1c23e
parentb5cffad2d48b0e0f280b7c132a10e0405a0aa50a (diff)
libcamera: process: fix error checking
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@ideasonboard.com>
-rw-r--r--src/libcamera/process.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libcamera/process.cpp b/src/libcamera/process.cpp
index aee33735..6c41da21 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;