changeset 7248:a7cf06964339

6984762: Invalid close of file descriptor '-1' in findZoneinfoFile Reviewed-by: okutsu
author coffeys
date Wed, 02 Jul 2014 15:05:17 +0100
parents 78c8ed952f6d
children 66a3e7b2bb11
files src/solaris/native/java/util/TimeZone_md.c
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/solaris/native/java/util/TimeZone_md.c	Wed Jul 02 13:01:35 2014 +0100
+++ b/src/solaris/native/java/util/TimeZone_md.c	Wed Jul 02 15:05:17 2014 +0100
@@ -172,7 +172,6 @@
                 break;
             }
             if ((fd = open(pathname, O_RDONLY)) == -1) {
-                fd = 0;
                 break;
             }
             if (read(fd, dbuf, size) != (ssize_t) size) {
@@ -188,7 +187,7 @@
             free((void *) dbuf);
             dbuf = NULL;
             (void) close(fd);
-            fd = 0;
+            fd = -1;
         }
         free((void *) pathname);
         pathname = NULL;
@@ -203,7 +202,7 @@
     if (pathname != NULL) {
         free((void *) pathname);
     }
-    if (fd != 0) {
+    if (fd != -1) {
         (void) close(fd);
     }
     if (dbuf != NULL) {