< prev index next >
src/java.base/share/native/libjli/parse_manifest.c
Print this page
rev 53302 : 8217093: Support extended-length paths in parse_manifest.c on windows
*** 1,7 ****
/*
! * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 360,372 ****
--- 360,374 ----
}
bp = buffer;
if (find_positions(fd, bp, &base_offset, &censtart) == -1) {
+ free(buffer);
return -1;
}
if (JLI_Lseek(fd, censtart, SEEK_SET) < (jlong) 0) {
+ free(buffer);
return -1;
}
if ((bytes = read(fd, bp, MINREAD)) < 0) {
free(buffer);
*** 560,569 ****
--- 562,577 ----
*value = cp;
*lp = nl;
return (1);
}
+ #ifdef _WIN32
+ int open_jarfile(const char* name, int flags);
+ #else
+ int open_jarfile(const char* name, int flags) { return open(name, flags); }
+ #endif
+
/*
* Read the manifest from the specified jar file and fill in the manifest_info
* structure with the information found within.
*
* Error returns are as follows:
*** 581,591 ****
char *name;
char *value;
int rc;
char *splashscreen_name = NULL;
! if ((fd = open(jarfile, O_RDONLY
#ifdef O_LARGEFILE
| O_LARGEFILE /* large file mode */
#endif
#ifdef O_BINARY
| O_BINARY /* use binary mode on windows */
--- 589,599 ----
char *name;
char *value;
int rc;
char *splashscreen_name = NULL;
! if ((fd = open_jarfile(jarfile, O_RDONLY
#ifdef O_LARGEFILE
| O_LARGEFILE /* large file mode */
#endif
#ifdef O_BINARY
| O_BINARY /* use binary mode on windows */
*** 638,648 ****
JLI_JarUnpackFile(const char *jarfile, const char *filename, int *size) {
int fd;
zentry entry;
void *data = NULL;
! if ((fd = open(jarfile, O_RDONLY
#ifdef O_LARGEFILE
| O_LARGEFILE /* large file mode */
#endif
#ifdef O_BINARY
| O_BINARY /* use binary mode on windows */
--- 646,656 ----
JLI_JarUnpackFile(const char *jarfile, const char *filename, int *size) {
int fd;
zentry entry;
void *data = NULL;
! if ((fd = open_jarfile(jarfile, O_RDONLY
#ifdef O_LARGEFILE
| O_LARGEFILE /* large file mode */
#endif
#ifdef O_BINARY
| O_BINARY /* use binary mode on windows */
*** 686,696 ****
char *lp; /* pointer into manifest, updated during iteration */
char *name;
char *value;
int rc;
! if ((fd = open(jarfile, O_RDONLY
#ifdef O_LARGEFILE
| O_LARGEFILE /* large file mode */
#endif
#ifdef O_BINARY
| O_BINARY /* use binary mode on windows */
--- 694,704 ----
char *lp; /* pointer into manifest, updated during iteration */
char *name;
char *value;
int rc;
! if ((fd = open_jarfile(jarfile, O_RDONLY
#ifdef O_LARGEFILE
| O_LARGEFILE /* large file mode */
#endif
#ifdef O_BINARY
| O_BINARY /* use binary mode on windows */
< prev index next >