summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--uisimulator/common/io.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/uisimulator/common/io.c b/uisimulator/common/io.c
index 56abf4b6ad..f77180dc21 100644
--- a/uisimulator/common/io.c
+++ b/uisimulator/common/io.c
@@ -309,6 +309,14 @@ MYDIR *sim_opendir(const char *name)
309 return (MYDIR *)0; 309 return (MYDIR *)0;
310} 310}
311 311
312#if defined(WIN32)
313static inline struct tm* localtime_r (const time_t *clock, struct tm *result) {
314 if (!clock || !result) return NULL;
315 memcpy(result,localtime(clock),sizeof(*result));
316 return result;
317}
318#endif
319
312struct sim_dirent *sim_readdir(MYDIR *dir) 320struct sim_dirent *sim_readdir(MYDIR *dir)
313{ 321{
314 char buffer[MAX_PATH]; /* sufficiently big */ 322 char buffer[MAX_PATH]; /* sufficiently big */
@@ -346,7 +354,7 @@ struct sim_dirent *sim_readdir(MYDIR *dir)
346 (tm.tm_min << 5) | 354 (tm.tm_min << 5) |
347 (tm.tm_sec >> 1); 355 (tm.tm_sec >> 1);
348 356
349#ifdef HAVE_LSTAT 357#if HAVE_LSTAT
350#define ATTR_LINK 0x80 358#define ATTR_LINK 0x80
351 if (!lstat(buffer, &s) && S_ISLNK(s.st_mode)) 359 if (!lstat(buffer, &s) && S_ISLNK(s.st_mode))
352 { 360 {