jdk/src/java.base/share/native/libzip/ZipFile.c
changeset 27186 c1b8debdfcc2
parent 27084 d7fbf9a294af
parent 27184 2996674bd701
child 33653 c1ee09fe3274
--- a/jdk/src/java.base/share/native/libzip/ZipFile.c	Fri Oct 17 10:59:32 2014 +0100
+++ b/jdk/src/java.base/share/native/libzip/ZipFile.c	Fri Oct 17 07:58:57 2014 -0700
@@ -93,24 +93,27 @@
     jzfile *zip = 0;
 
     if (mode & OPEN_READ) flag |= O_RDONLY;
-    if (mode & OPEN_DELETE) flag |= JVM_O_DELETE;
 
     if (path != 0) {
         zip = ZIP_Get_From_Cache(path, &msg, lastModified);
         if (zip == 0 && msg == 0) {
             ZFILE zfd = 0;
 #ifdef WIN32
+            if (mode & OPEN_DELETE) flag |= O_TEMPORARY;
             zfd = winFileHandleOpen(env, name, flag);
             if (zfd == -1) {
                 /* Exception already pending. */
                 goto finally;
             }
 #else
-            zfd = JVM_Open(path, flag, 0);
+            zfd = open(path, flag, 0);
             if (zfd < 0) {
                 throwFileNotFoundException(env, name);
                 goto finally;
             }
+            if (mode & OPEN_DELETE) {
+                unlink(path);
+            }
 #endif
             zip = ZIP_Put_In_Cache0(path, zfd, &msg, lastModified, usemmap);
         }