blob: d9ddd61917ccb2c6b2ab9e05e2f761b6430ca5f2 [file] [log] [blame]
diff --git a/fileio.c b/fileio.c
--- a/fileio.c
+++ b/fileio.c
@@ -1822,8 +1822,15 @@ time_t dos_to_unix_time(dosdatetime)
/* tzset was already called at start of process_zipfiles() */
/* tzset(); */ /* set `timezone' variable */
#ifndef __BEOS__ /* BeOS DR8 has no timezones... */
+ /* TODO(hamaji): remove once this gets fixed:
+ * https://code.google.com/p/nativeclient/issues/detail?id=3737
+ */
+#if defined(__native_client__) && defined(_NEWLIB_VERSION)
+ m_time += _timezone; /* seconds WEST of GMT: add */
+#else
m_time += timezone; /* seconds WEST of GMT: add */
#endif
+#endif
#endif /* ?(BSD || MTS || __GO32__) */
#endif /* ?WIN32 */
TTrace((stderr, " m_time after timezone = %lu\n", (ulg)m_time));
diff --git a/process.c b/process.c
--- a/process.c
+++ b/process.c
@@ -729,7 +729,8 @@ static int do_seekable(__G__ lastchance) /* return PK-type error code */
if (open_input_file(__G)) /* this should never happen, given */
return PK_NOZIP; /* the stat() test above, but... */
-#ifdef DO_SAFECHECK_2GB
+ /* nacl_io's HTTP FS does not support lseek so this check will fail */
+#if defined(DO_SAFECHECK_2GB) && !defined(__native_client__)
/* Need more care: Do not trust the size returned by stat() but
determine it by reading beyond the end of the file. */
G.ziplen = file_size(G.zipfd);
diff --git a/unix/unix.c b/unix/unix.c
--- a/unix/unix.c
+++ b/unix/unix.c
@@ -1242,6 +1242,11 @@ void close_outfile(__G) /* GRR: change to return PK-style warning level */
fclose(G.outfile);
#endif /* !NO_FCHOWN && !NO_FCHMOD */
+ /*
+ * TODO(bradnelson): Remove this once utime work under newlib.
+ * See: crbug.com/387487
+ */
+#if !defined(__native_client__) || !defined(_NEWLIB_VERSION)
/* skip restoring time stamps on user's request */
if (uO.D_flag <= 1) {
/* set the file's access and modification times */
@@ -1254,6 +1259,7 @@ void close_outfile(__G) /* GRR: change to return PK-style warning level */
strerror(errno)));
}
}
+#endif
#if (defined(NO_FCHOWN) || defined(NO_FCHMOD))
/*---------------------------------------------------------------------------
diff --git a/unix/unxcfg.h b/unix/unxcfg.h
--- a/unix/unxcfg.h
+++ b/unix/unxcfg.h
@@ -200,7 +200,7 @@ typedef struct stat z_stat;
#if (!defined(NO_LCHOWN) || !defined(NO_LCHMOD))
# define SET_SYMLINK_ATTRIBS
#endif
-#ifdef MTS
+#if defined(MTS) || defined(__native_client__)
# ifdef SET_DIR_ATTRIB
# undef SET_DIR_ATTRIB
# endif