From bc9c81a2459ece7d576885b210fc00c89ab1bc3a Mon Sep 17 00:00:00 2001 From: Denys Kondratenko Date: Wed, 23 Aug 2023 10:48:33 +0200 Subject: [PATCH] don't ask for overwrite for the char device (#141) `/dev/videoX` should always exists for the `--muxer=v4l2`, don't ask permission to override it. Fixes #140. --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 4c4a216..b78711f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -577,7 +577,7 @@ void handle_graceful_termination(int) static bool user_specified_overwrite(std::string filename) { struct stat buffer; - if (stat (filename.c_str(), &buffer) == 0) + if (stat (filename.c_str(), &buffer) == 0 && !S_ISCHR(buffer.st_mode)) { std::string input; std::cout << "Output file \"" << filename << "\" exists. Overwrite? Y/n: ";