+ error_msg_and_die(io_error, tarName);
+
+#ifdef CONFIG_FEATURE_TAR_GZIP
+ if (gzip) {
+ if (pipe(gzipDataPipe) < 0 || pipe(gzipStatusPipe) < 0) {
+ perror_msg_and_die("Failed to create gzip pipe");
+ }
+
+ signal(SIGPIPE, SIG_IGN); /* we only want EPIPE on errors */
+
+# if __GNUC__
+ /* Avoid vfork clobbering */
+ (void) &include;
+ (void) &errorFlag;
+# endif
+
+ gzipPid = vfork();
+
+ if (gzipPid == 0) {
+ dup2(gzipDataPipe[0], 0);
+ close(gzipDataPipe[1]);
+
+ if (tbInfo.tarFd != 1);
+ dup2(tbInfo.tarFd, 1);
+
+ close(gzipStatusPipe[0]);
+ fcntl(gzipStatusPipe[1], F_SETFD, FD_CLOEXEC); /* close on exec shows sucess */
+
+ execl("/bin/gzip", "gzip", "-f", 0);
+ vfork_exec_errno = errno;
+
+ close(gzipStatusPipe[1]);
+ exit(-1);
+ } else if (gzipPid > 0) {
+ close(gzipDataPipe[0]);
+ close(gzipStatusPipe[1]);
+
+ while (1) {
+ char buf;
+
+ int n = read(gzipStatusPipe[0], &buf, 1);
+
+ if (n == 0 && vfork_exec_errno != 0) {
+ errno = vfork_exec_errno;
+ perror_msg_and_die("Could not exec gzip process");
+ } else if ((n < 0) && (errno == EAGAIN || errno == EINTR))
+ continue; /* try it again */
+ break;
+ }
+ close(gzipStatusPipe[0]);
+
+ tbInfo.tarFd = gzipDataPipe[1];
+ } else {
+ perror_msg_and_die("Failed to vfork gzip process");
+ }
+ }
+#endif
+
+ tbInfo.excludeList = exclude;