From 0a1abce976941945d04441ca90e95c18c6f90a16 Mon Sep 17 00:00:00 2001 From: phyto Date: Sat, 20 Jul 2019 04:09:39 +0200 Subject: [PATCH] better error handling, part 28 --- v4l2/grabvidseq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/v4l2/grabvidseq.c b/v4l2/grabvidseq.c index caf5306..ac4c2bb 100644 --- a/v4l2/grabvidseq.c +++ b/v4l2/grabvidseq.c @@ -49,6 +49,7 @@ do { if (r == -1) { fprintf(stderr, "error %d, %s\n", errno, strerror(errno)); + sleep(1); exit(EXIT_FAILURE); } } @@ -103,7 +104,7 @@ if (verbosity) { fd = v4l2_open(dev_name, O_RDWR | O_NONBLOCK, 0); if (fd < 0) { - perror("Cannot open device"); + perror(dev_name); exit(EXIT_FAILURE); }