From 3ec5aa6720c32d32cd26cf52c0e35bf61830c879 Mon Sep 17 00:00:00 2001 From: Paul Elder Date: Tue, 12 Jun 2018 14:17:04 +0900 Subject: uvc: check ioctl return value for error There is code that is meant to check for the error of an ioctl, but the return variable that it checks isn't actually assigned from the ioctl. Assign the return value before checking it. Signed-off-by: Paul Elder [Fixed error message] Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart --- lib/uvc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/uvc.c') diff --git a/lib/uvc.c b/lib/uvc.c index f8e913a..695db5b 100644 --- a/lib/uvc.c +++ b/lib/uvc.c @@ -329,10 +329,10 @@ static void uvc_events_process(void *d) return; } - ioctl(dev->vdev->fd, UVCIOC_SEND_RESPONSE, &resp); + ret = ioctl(dev->vdev->fd, UVCIOC_SEND_RESPONSE, &resp); if (ret < 0) { - printf("UVCIOC_S_EVENT failed: %s (%d)\n", strerror(errno), - errno); + printf("UVCIOC_SEND_RESPONSE failed: %s (%d)\n", + strerror(errno), errno); return; } } -- cgit v1.2.3