mirror of
https://github.com/curl/curl.git
synced 2025-09-13 15:42:39 +03:00
fopen: fix narrowing conversion warning on 32-bit Android
This was fixed in commit06dc599405
, but came back in commit03cb1ff4d6
. When building for 32-bit ARM or x86 Android, `st_mode` is defined as `unsigned int` instead of `mode_t`, resulting in a `-Wimplicit-int-conversion` clang warning because `mode_t` is `unsigned short`. Add a cast to silence the warning, but only for 32-bit Android builds, because other architectures and platforms are not affected. Ref: https://android.googlesource.com/platform/bionic/+/refs/tags/ndk-r25c/libc/include/sys/stat.h#86 Closes https://github.com/curl/curl/pull/12998
This commit is contained in:
parent
3755153571
commit
f0eacd9447
|
@ -129,7 +129,12 @@ CURLcode Curl_fopen(struct Curl_easy *data, const char *filename,
|
|||
}
|
||||
|
||||
result = CURLE_WRITE_ERROR;
|
||||
#if (defined(ANDROID) || defined(__ANDROID__)) && \
|
||||
(defined(__i386__) || defined(__arm__))
|
||||
fd = open(tempstore, O_WRONLY | O_CREAT | O_EXCL, (mode_t)(0600|sb.st_mode));
|
||||
#else
|
||||
fd = open(tempstore, O_WRONLY | O_CREAT | O_EXCL, 0600|sb.st_mode);
|
||||
#endif
|
||||
if(fd == -1)
|
||||
goto fail;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user