better error handling, part 28

This commit is contained in:
phyto 2019-07-20 04:09:39 +02:00
parent bcf57f8764
commit 0a1abce976
1 changed files with 2 additions and 1 deletions

View File

@ -49,6 +49,7 @@ do {
if (r == -1) { if (r == -1) {
fprintf(stderr, "error %d, %s\n", errno, strerror(errno)); fprintf(stderr, "error %d, %s\n", errno, strerror(errno));
sleep(1);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
} }
@ -103,7 +104,7 @@ if (verbosity) {
fd = v4l2_open(dev_name, O_RDWR | O_NONBLOCK, 0); fd = v4l2_open(dev_name, O_RDWR | O_NONBLOCK, 0);
if (fd < 0) { if (fd < 0) {
perror("Cannot open device"); perror(dev_name);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }