aboutsummaryrefslogtreecommitdiff
path: root/src/xz/file_io.c
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2019-06-23 23:19:34 +0300
committerLasse Collin <lasse.collin@tukaani.org>2019-06-23 23:19:34 +0300
commit7883d73530b4b2a701ddd7d50c35676cbc158039 (patch)
treedea64895ae28278af681691c029f3e1c8c7cedd2 /src/xz/file_io.c
parenttuklib_cpucores: Silence warnings from -Wsign-conversion. (diff)
downloadxz-7883d73530b4b2a701ddd7d50c35676cbc158039.tar.xz
xz: Fix some of the warnings from -Wsign-conversion.
Diffstat (limited to '')
-rw-r--r--src/xz/file_io.c5
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: