Skip to content

Commit

Permalink
don't ask for overwrite for the char device (#141)
Browse files Browse the repository at this point in the history
`/dev/videoX` should always exists for the `--muxer=v4l2`, don't ask permission to override it. Fixes #140.
  • Loading branch information
denisok authored Aug 23, 2023
1 parent d914555 commit bc9c81a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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: ";
Expand Down

0 comments on commit bc9c81a

Please sign in to comment.