From: Ulrich Drepper Date: Fri, 22 May 1998 10:11:05 +0000 (+0000) Subject: (__open_catalog): Don't try to close file which isn't open to preserve X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7921772daef4e734a225b98577a6f909fd4a52f7;p=thirdparty%2Fglibc.git (__open_catalog): Don't try to close file which isn't open to preserve correct error number. --- diff --git a/catgets/open_catalog.c b/catgets/open_catalog.c index fa4f0778189..c3f10ffe537 100644 --- a/catgets/open_catalog.c +++ b/catgets/open_catalog.c @@ -163,7 +163,8 @@ __open_catalog (__nl_catd catalog, int with_path) if (fd < 0 || __fstat (fd, &st) < 0 || !S_ISREG (st.st_mode)) { - __close (fd); + if (fd != -1) + __close (fd); catalog->status = nonexisting; return; }