diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2019-06-23 23:19:34 +0300 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2019-06-23 23:19:34 +0300 |
commit | 7883d73530b4b2a701ddd7d50c35676cbc158039 (patch) | |
tree | dea64895ae28278af681691c029f3e1c8c7cedd2 /src/xz/file_io.c | |
parent | tuklib_cpucores: Silence warnings from -Wsign-conversion. (diff) | |
download | xz-7883d73530b4b2a701ddd7d50c35676cbc158039.tar.xz |
xz: Fix some of the warnings from -Wsign-conversion.
Diffstat (limited to '')
-rw-r--r-- | src/xz/file_io.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/xz/file_io.c b/src/xz/file_io.c index 48ef8223..43db7c7f 100644 --- a/src/xz/file_io.c +++ b/src/xz/file_io.c @@ -360,13 +360,14 @@ io_copy_attrs(const file_pair *pair) // Try changing the owner of the file. If we aren't root or the owner // isn't already us, fchown() probably doesn't succeed. We warn // about failing fchown() only if we are root. - if (fchown(pair->dest_fd, pair->src_st.st_uid, -1) && warn_fchown) + if (fchown(pair->dest_fd, pair->src_st.st_uid, (gid_t)(-1)) + && warn_fchown) message_warning(_("%s: Cannot set the file owner: %s"), pair->dest_name, strerror(errno)); mode_t mode; - if (fchown(pair->dest_fd, -1, pair->src_st.st_gid)) { + if (fchown(pair->dest_fd, (uid_t)(-1), pair->src_st.st_gid)) { message_warning(_("%s: Cannot set the file group: %s"), pair->dest_name, strerror(errno)); // We can still safely copy some additional permissions: |