From: Christos Zoulas Date: Fri, 12 Dec 2014 16:33:01 +0000 (+0000) Subject: PR/405: Ignore exit code from uncompress programs because some (validly) X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=eaa0843c59cb8fe450278d52429a953777168e29;p=file PR/405: Ignore exit code from uncompress programs because some (validly) exit with non-zero code when they get SIGPIPE. --- diff --git a/src/compress.c b/src/compress.c index 3330a2be..e968bb45 100644 --- a/src/compress.c +++ b/src/compress.c @@ -35,7 +35,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: compress.c,v 1.76 2014/12/11 11:47:08 christos Exp $") +FILE_RCSID("@(#)$File: compress.c,v 1.77 2014/12/12 16:33:01 christos Exp $") #endif #include "magic.h" @@ -512,11 +512,16 @@ err: strerror(errno)); #endif n = NODATA; - } else if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) { + } else if (!WIFEXITED(status)) { #ifdef DEBUG - (void)fprintf(stderr, "Child status (0x%x)\n", status); + (void)fprintf(stderr, "Child not exited (0x%x)\n", + status); +#endif + } else if (WEXITSTATUS(status) != 0) { +#ifdef DEBUG + (void)fprintf(stderr, "Child exited (0x%d)\n", + WEXITSTATUS(status)); #endif - n = NODATA; } (void) close(fdin[0]);