- if (s1->flags&F_MODE && s1->st_mode != (s2->st_mode&07777) &&
- chmod(path, s1->st_mode))
- (void)printf("%s: permissions not set: %s\n",
- path + 2, strerror(errno));
- if (s1->flags&F_OWNER && s1->st_uid != s2->st_uid &&
- chown(path, s1->st_uid, -1))
- (void)printf("%s: owner not modified: %s\n",
- path + 2, strerror(errno));
- if (s1->flags&F_GROUP && s1->st_gid != s2->st_gid &&
- chown(path, -1, s1->st_gid))
- (void)printf("%s: group not modified: %s\n",
- path + 2, strerror(errno));
+ if (!create)
+ continue;
+ if (chown(path, p->st_uid, p->st_gid)) {
+ (void)printf("%s: owner/group/mode not modified: %s\n",
+ path, strerror(errno));
+ continue;
+ }
+ if (chmod(path, p->st_mode))
+ (void)printf("%s: permissions not set: %s\n",
+ path, strerror(errno));
+ }