]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(__open_catalog): Don't try to close file which isn't open to preserve
authorUlrich Drepper <drepper@redhat.com>
Fri, 22 May 1998 10:11:05 +0000 (10:11 +0000)
committerUlrich Drepper <drepper@redhat.com>
Fri, 22 May 1998 10:11:05 +0000 (10:11 +0000)
correct error number.

catgets/open_catalog.c

index fa4f077818926b908135b58096f842633a8a85e7..c3f10ffe5376dadd84c09c30464d3c78094bdcdf 100644 (file)
@@ -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;
     }