aboutsummaryrefslogtreecommitdiff
path: root/src/os_unix.c
diff options
context:
space:
mode:
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 */
}