From: Shuah Khan Date: Thu, 25 Feb 2016 17:17:42 +0000 (-0700) Subject: selftests: media_dcevice_test fix to handle ioctl failure case X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=36d3f7d8204dabc225febdeca9db8a3114cc9b6d;p=linux-beck.git selftests: media_dcevice_test fix to handle ioctl failure case Fix to print information returned by ioctl only when it returns success. Signed-off-by: Shuah Khan --- diff --git a/tools/testing/selftests/media_tests/media_device_test.c b/tools/testing/selftests/media_tests/media_device_test.c index a47880b9e00a..7a4d613f4742 100644 --- a/tools/testing/selftests/media_tests/media_device_test.c +++ b/tools/testing/selftests/media_tests/media_device_test.c @@ -86,8 +86,9 @@ int main(int argc, char **argv) ret = ioctl(fd, MEDIA_IOC_DEVICE_INFO, &mdi); if (ret < 0) printf("Media Device Info errno %s\n", strerror(errno)); - printf("Media device model %s driver %s\n", - mdi.model, mdi.driver); + else + printf("Media device model %s driver %s\n", + mdi.model, mdi.driver); sleep(10); count++; }