When comparing -1 to a group id, cast -1 with gid_t because on some systems
[rsync/rsync.git] / rsync.c
diff --git a/rsync.c b/rsync.c
index ceabfda..178dc52 100644 (file)
--- a/rsync.c
+++ b/rsync.c
@@ -180,8 +180,8 @@ int set_perms(char *fname,struct file_struct *file,STRUCT_STAT *st,
        }
 
        change_uid = am_root && preserve_uid && st->st_uid != file->uid;
-       change_gid = !am_daemon && preserve_gid && file->gid != -1 \
-                               && st->st_gid != file->gid;
+       change_gid = !am_daemon && preserve_gid && file->gid != (gid_t) -1 && \
+                               st->st_gid != file->gid;
        if (change_gid && !am_root) {
                /* enforce bsd-style group semantics: non-root can only
                    change to groups that the user is a member of */