From: Ian Jackson Date: Fri, 14 Aug 2009 19:09:57 +0000 (+0100) Subject: Handle opening errors in gzopen properly X-Git-Tag: 3.1^0 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.main.git;a=commitdiff_plain;h=89ac616c0df890ff63e6b7db5ae2a3c084e2f2c1 Handle opening errors in gzopen properly --- diff --git a/yarrg/common.c b/yarrg/common.c index f95e585..cc33235 100644 --- a/yarrg/common.c +++ b/yarrg/common.c @@ -122,7 +122,7 @@ int gzopen(const char *zpath, int oflags, FILE **f_r, pid_t *pid_r, const char *gziplevel /* 0 for read; may be 0, or "-1" etc. */) { int zfd= open(zpath, oflags, 0666); - if (!zfd) return errno; + if (zfd<0) return errno; int pipefds[2]; sysassert(! pipe(pipefds) );