aboutsummaryrefslogtreecommitdiff
path: root/src/os_unix.c
diff options
context:
space:
mode:
authordan <dan@noemail.net>2016-01-25 18:43:05 +0000
committerdan <dan@noemail.net>2016-01-25 18:43:05 +0000
commitaf1b36b1df592aa8ecf1fd8799db7e415688ed6e (patch)
tree636357bc0b2821dc5ffa0e6469ae47844604cef8 /src/os_unix.c
parentcaf6b150a1077f2d4293b4091247c7e932da3927 (diff)
downloadsqlite-af1b36b1df592aa8ecf1fd8799db7e415688ed6e.tar.gz
sqlite-af1b36b1df592aa8ecf1fd8799db7e415688ed6e.zip
Only use lstat() if the HAVE_LSTAT macro is defined. Fix some test file issues.
FossilOrigin-Name: 8a6e4147a680ad6c5fdd588468b6daac82349d2c
Diffstat (limited to 'src/os_unix.c')
-rw-r--r--src/os_unix.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/os_unix.c b/src/os_unix.c
index 3d113301b..a3bb45bdb 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -480,7 +480,11 @@ static struct unix_syscall {
#endif
#define osReadlink ((ssize_t(*)(const char*,char*,size_t))aSyscall[26].pCurrent)
- { "lstat", (sqlite3_syscall_ptr)lstat, 0 },
+#if defined(HAVE_LSTAT)
+ { "lstat", (sqlite3_syscall_ptr)lstat, 0 },
+#else
+ { "lstat", (sqlite3_syscall_ptr)0, 0 },
+#endif
#define osLstat ((int(*)(const char*,struct stat*))aSyscall[27].pCurrent)
}; /* End of the overrideable system calls */
@@ -5971,7 +5975,7 @@ static int unixFullPathname(
int nOut, /* Size of output buffer in bytes */
char *zOut /* Output buffer */
){
-#if !defined(HAVE_READLINK)
+#if !defined(HAVE_READLINK) || !defined(HAVE_LSTAT)
return mkFullPathname(zPath, zOut, nOut);
#else
int rc = SQLITE_OK;
@@ -5999,7 +6003,7 @@ static int unixFullPathname(
struct stat buf;
if( osLstat(zIn, &buf)!=0 ){
if( errno!=ENOENT ){
- rc = unixLogError(SQLITE_CANTOPEN_BKPT, "stat", zIn);
+ rc = unixLogError(SQLITE_CANTOPEN_BKPT, "lstat", zIn);
}
}else{
bLink = S_ISLNK(buf.st_mode);
@@ -6044,7 +6048,7 @@ static int unixFullPathname(
sqlite3_free(zDel);
return rc;
-#endif /* HAVE_READLINK */
+#endif /* HAVE_READLINK && HAVE_LSTAT */
}