Skip to content

Commit

Permalink
no perror when EAGAIN is returned
Browse files Browse the repository at this point in the history
  • Loading branch information
mpromonet committed May 4, 2024
1 parent 81181c8 commit 3eff050
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/V4l2MmapDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,12 @@ size_t V4l2MmapDevice::readInternal(char* buffer, size_t bufferSize)

if (-1 == ioctl(m_fd, VIDIOC_DQBUF, &buf))
{
perror("VIDIOC_DQBUF");
size = -1;
if (errno == EAGAIN) {
size = 0;
} else {
perror("VIDIOC_DQBUF");
size = -1;
}
}
else if (buf.index < n_buffers)
{
Expand Down

0 comments on commit 3eff050

Please sign in to comment.