diff options
author | Shuah Khan <shuahkh@osg.samsung.com> | 2016-02-25 12:17:42 -0500 |
---|---|---|
committer | Shuah Khan <shuahkh@osg.samsung.com> | 2016-02-25 19:22:36 -0500 |
commit | 36d3f7d8204dabc225febdeca9db8a3114cc9b6d (patch) | |
tree | ae718929c8ddf3c855d9ca1581245034f2696722 | |
parent | 3b48bfc0ab997d43fa89190c769a881db853c569 (diff) |
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 <shuahkh@osg.samsung.com>
-rw-r--r-- | tools/testing/selftests/media_tests/media_device_test.c | 5 |
1 files changed, 3 insertions, 2 deletions
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) | |||
86 | ret = ioctl(fd, MEDIA_IOC_DEVICE_INFO, &mdi); | 86 | ret = ioctl(fd, MEDIA_IOC_DEVICE_INFO, &mdi); |
87 | if (ret < 0) | 87 | if (ret < 0) |
88 | printf("Media Device Info errno %s\n", strerror(errno)); | 88 | printf("Media Device Info errno %s\n", strerror(errno)); |
89 | printf("Media device model %s driver %s\n", | 89 | else |
90 | mdi.model, mdi.driver); | 90 | printf("Media device model %s driver %s\n", |
91 | mdi.model, mdi.driver); | ||
91 | sleep(10); | 92 | sleep(10); |
92 | count++; | 93 | count++; |
93 | } | 94 | } |