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:
Viktor Szakats 2025-01-01 03:28:09 +01:00
parent 5054c68b58
commit 70b49a4e4c
No known key found for this signature in database
GPG Key ID: B5ABD165E2AEF201

View File

@ -323,7 +323,12 @@ static CURLcode file_upload(struct Curl_easy *data)
else
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);
#endif
if(fd < 0) {
failf(data, "cannot open %s for writing", file->path);
return CURLE_WRITE_ERROR;