Message ID | d9391147-7ab5-4047-fc63-ae2c952b22e1@dabe.com |
---|---|
State | New |
Headers | show |
Series | Make "File exists" exit w/ non-zero status | expand |
Context | Check | Description |
---|---|---|
andriy/configure_x86 | warning | Failed to apply patch |
Gyan: > The former is not an error. The user was asked and the application > behaved as per their reply. Could it make sense to only return the AVERROR(EEXIST) if -nostdin is passed (otherwise current behavior)? I have observed this behavior too and think it's strange only in the -nostdin case.
On 2024-07-16 09:40 am, Marth64 wrote: > Gyan: >> The former is not an error. The user was asked and the application >> behaved as per their reply. > Could it make sense to only return the AVERROR(EEXIST) if -nostdin is > passed (otherwise current behavior)? Agreed. Regards, Gyan
diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c index 2c201c74b2..dddf7c6475 100644 --- a/fftools/ffmpeg_opt.c +++ b/fftools/ffmpeg_opt.c @@ -604,13 +604,13 @@ int assert_file_overwrite(const char *filename) signal(SIGINT, SIG_DFL); if (!read_yesno()) { av_log(NULL, AV_LOG_FATAL, "Not overwriting - exiting\n"); - return AVERROR_EXIT; + return AVERROR(EEXIST); } term_init(); } else { av_log(NULL, AV_LOG_FATAL, "File '%s' already exists. Exiting.\n", filename); - return AVERROR_EXIT; + return AVERROR(EEXIST); } } }