#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <errno.h>
#include "libbb.h"
static FILE *in_file, *out_file;
}
if (fwrite(window, 1, outcnt, out_file) != outcnt) {
+ /*
+ * The Parent process may not be interested in all the data we have,
+ * in which case it will rudely close its end of the pipe and
+ * wait for us to exit.
+ */
+ if (errno == EPIPE)
+ _exit(EXIT_SUCCESS);
+
error_msg("Couldnt write");
_exit(EXIT_FAILURE);
}
}
#endif
+ signal(SIGPIPE, SIG_IGN);
+
/* Allocate all global buffers (for DYN_ALLOC option) */
window = xmalloc((size_t)(((2L*WSIZE)+1L)*sizeof(unsigned char)));
outcnt = 0;