ref: fc3cb31e545ef5afe71e155275e2bb454491e0d1
parent: 795b53490a5f52bc535f83141e6e8000bf0275ae
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Tue Feb 13 08:39:10 EST 2018
[ar] Flush stdout before finishing Ar writes to stdout in several places, and these writes can be lost due to some error. This flush is used to verify that all the writes were correct.
--- a/ar/main.c
+++ b/ar/main.c
@@ -480,5 +480,10 @@
if (tmp)
closetmp(tmp, afile);
+ if (fflush(stdout) == EOF) {
+ perror("ar:error writing to stdout");
+ exit(1);
+ }
+
return 0;
}