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>
This commit is contained in:
Shuah Khan 2016-02-25 10:17:42 -07:00
parent 3b48bfc0ab
commit 36d3f7d820
1 changed files with 3 additions and 2 deletions

View File

@ -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++;
}