diff options
| author | Demi M. Obenour <demiobenour@gmail.com> | 2020-12-28 18:33:22 -0500 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2025-05-19 17:06:31 +0000 |
| commit | 1eb729ef1c795f6b5944dd217994f8d8279672bc (patch) | |
| tree | 7fcab49925442011d731acbbfd90934ed5712f09 /apt-private | |
| parent | fb57847947daa41291e87ce2a9e66e8dcca104b3 (diff) | |
Fail on stdio errors
If there is an error writing to cout, cerr, or clog, APT should return a
non-zero exit code. This allows automated tools to reliably check for
warnings.
Diffstat (limited to 'apt-private')
| -rw-r--r-- | apt-private/private-cmndline.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/apt-private/private-cmndline.cc b/apt-private/private-cmndline.cc index 67a34a2c7..e16aa7280 100644 --- a/apt-private/private-cmndline.cc +++ b/apt-private/private-cmndline.cc @@ -622,7 +622,7 @@ unsigned short DispatchCommandLine(CommandLine &CmdL, std::vector<CommandLine::D _error->DumpErrors(); else _error->DumpErrors(GlobalError::NOTICE); - if (returned == false) + if (returned == false || std::cout.bad() || std::cerr.bad() || std::clog.bad()) return 100; return Errors == true ? 100 : 0; } |
