diff options
author | Demi Marie Obenour <demi@invisiblethingslab.com> | 2021-04-12 11:30:51 -0400 |
---|---|---|
committer | Florian Festi <ffesti@redhat.com> | 2022-01-21 15:44:28 +0100 |
commit | fc8386be36a32f8462a0d16a2dd3e5e18f7fbc2d (patch) | |
tree | 731d96e0a283b8c52ac9a89f2208f8da2a50a4d4 /rpmkeys.c | |
parent | ed07a187734addfa16be9ee922398e4ff9859f53 (diff) | |
download | rpm-fc8386be36a32f8462a0d16a2dd3e5e18f7fbc2d.tar.gz |
rpmkeys: exit non-zero on I/O errors
If writing to stdout or stderr fails, rpmkeys should exit with a
non-zero status code.
Diffstat (limited to 'rpmkeys.c')
-rw-r--r-- | rpmkeys.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -86,5 +86,9 @@ int main(int argc, char *argv[]) exit: rpmtsFree(ts); rpmcliFini(optCon); + fflush(stderr); + fflush(stdout); + if (ferror(stdout) || ferror(stderr)) + return 255; /* I/O error */ return ec; } |