From a00336f6fc7a39585be31b0c1921ecb880b9a617 Mon Sep 17 00:00:00 2001 From: Meep-Eep Date: Sat, 30 Aug 2008 20:52:57 +0000 Subject: [PATCH] Dirty hack for Symbian The Unholy. git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3061 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/sc2code/libs/uio/stdio/stdio.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/sc2/src/sc2code/libs/uio/stdio/stdio.c b/sc2/src/sc2code/libs/uio/stdio/stdio.c index 8abaac678..34b1306fb 100644 --- a/sc2/src/sc2code/libs/uio/stdio/stdio.c +++ b/sc2/src/sc2code/libs/uio/stdio/stdio.c @@ -407,11 +407,25 @@ stdio_getPDirEntryHandle(const uio_PDirHandle *pDirHandle, const char *name) { } if (stat(path, &statBuf) == -1) { - // errno is set. - int savedErrno = errno; - uio_free(path); - errno = savedErrno; - return NULL; +#ifdef __SYMBIAN32__ + // XXX: HACK: If we don't have access to a directory, we can still + // have access to the underlying entries. We don't actually know + // whether the entry is a directory, but I know of know way to find + // out. We just pretend that it is; worst case, a file which we can't + // access shows up as a directory which we can't access. + if (errno == EACCES) { + statBuf.st_mode = S_IFDIR; + // Fake a directory; the other fields of the stat + // structure are unused. + } else +#endif + { + // errno is set. + int savedErrno = errno; + uio_free(path); + errno = savedErrno; + return NULL; + } } uio_free(path);