diff options
author | stephan <stephan@noemail.net> | 2024-02-19 12:20:46 +0000 |
---|---|---|
committer | stephan <stephan@noemail.net> | 2024-02-19 12:20:46 +0000 |
commit | e0a9935be1c506646566f6b7845eb381bb219e16 (patch) | |
tree | dee82558b4732b057d94b0cda7c48de9e314efb4 /src/os_unix.c | |
parent | 6161cdd446eec170f7c0edf58d0d72a2cd3c5f85 (diff) | |
download | sqlite-e0a9935be1c506646566f6b7845eb381bb219e16.tar.gz sqlite-e0a9935be1c506646566f6b7845eb381bb219e16.zip |
Extend the strerror_r() result type discrepancy check in os_unix.c to include the Android NDK, as reported in [forum post 3f13857fa4062301|forum:3f13857fa4062301]. The NDK's strerror_r() signature is version-dependent, whereas this change assumes int return (POSIX semantic) across all versions.
FossilOrigin-Name: f18b2524da6bbbcf372b292df52fbe6efa49fd6e1f1f13ef2447279d559f7a08
Diffstat (limited to 'src/os_unix.c')
-rw-r--r-- | src/os_unix.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/os_unix.c b/src/os_unix.c index 4b3d63c2c..4663c22d9 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -1295,8 +1295,12 @@ static int unixLogErrorAtLine( ** available, the error message will often be an empty string. Not a ** huge problem. Incorrectly concluding that the GNU version is available ** could lead to a segfault though. + ** + ** Forum post 3f13857fa4062301 reports that the Android SDK may use + ** int-type return, depending on its version. */ -#if defined(STRERROR_R_CHAR_P) || defined(__USE_GNU) +#if (defined(STRERROR_R_CHAR_P) || defined(__USE_GNU)) \ + && !defined(ANDROID) && !defined(__ANDROID__) zErr = # endif strerror_r(iErrno, aErr, sizeof(aErr)-1); |