mirror of
https://github.com/curl/curl.git
synced 2026-08-25 09:53:32 +03:00
file: fix Android compiler warning
Apply the fix already used in `lib/fopen.c`.
```
lib/file.c:326:41: warning: implicit conversion loses integer precision: 'unsigned int' to 'mode_t' (aka 'unsigned short') [-Wimplicit-int-conversion]
326 | fd = open(file->path, mode, data->set.new_file_perms);
| ~~~~ ~~~~~~~~~~^~~~~~~~~~~~~~
```
Closes #15883
This commit is contained in:
parent
5054c68b58
commit
70b49a4e4c
1 changed files with 5 additions and 0 deletions
|
|
@ -323,7 +323,12 @@ static CURLcode file_upload(struct Curl_easy *data)
|
||||||
else
|
else
|
||||||
mode = MODE_DEFAULT|O_TRUNC;
|
mode = MODE_DEFAULT|O_TRUNC;
|
||||||
|
|
||||||
|
#if (defined(ANDROID) || defined(__ANDROID__)) && \
|
||||||
|
(defined(__i386__) || defined(__arm__))
|
||||||
|
fd = open(file->path, mode, (mode_t)data->set.new_file_perms);
|
||||||
|
#else
|
||||||
fd = open(file->path, mode, data->set.new_file_perms);
|
fd = open(file->path, mode, data->set.new_file_perms);
|
||||||
|
#endif
|
||||||
if(fd < 0) {
|
if(fd < 0) {
|
||||||
failf(data, "cannot open %s for writing", file->path);
|
failf(data, "cannot open %s for writing", file->path);
|
||||||
return CURLE_WRITE_ERROR;
|
return CURLE_WRITE_ERROR;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue