return 1;
}
- ret = xfrog_file_setattr(destdir->fd, pbuf->path, NULL, &fa,
- AT_SYMLINK_NOFOLLOW);
+ ret = xfrog_file_setattr(destdir->fd, pbuf->path, VFS_I(ip)->i_mode,
+ &fa, AT_SYMLINK_NOFOLLOW);
if (ret) {
if (errno == EOPNOTSUPP || errno == EPERM || errno == ENOTTY)
lost_mask |= LOST_FSXATTR;
attr.fa_xflags |= orflags;
attr.fa_xflags &= ~andflags;
- error = xfrog_file_setattr(AT_FDCWD, path, stat, &attr,
+ error = xfrog_file_setattr(AT_FDCWD, path, stat->st_mode, &attr,
AT_SYMLINK_NOFOLLOW);
if (error) {
fprintf(stderr, _("%s: cannot set flags on %s: %s\n"),
attr.fa_xflags |= orflags;
attr.fa_xflags &= ~andflags;
- error = xfrog_file_setattr(AT_FDCWD, name, &st, &attr,
+ error = xfrog_file_setattr(AT_FDCWD, name, st.st_mode, &attr,
AT_SYMLINK_NOFOLLOW);
if (error) {
fprintf(stderr, _("%s: cannot set flags on %s: %s\n"),
xfrog_file_setattr(
const int dfd,
const char *path,
- const struct stat *stat,
+ const mode_t mode,
struct file_attr *fa,
const unsigned int at_flags)
{
return error;
#endif
- if (SPECIAL_FILE(stat->st_mode)) {
+ if (SPECIAL_FILE(mode)) {
errno = EOPNOTSUPP;
return -1;
}
struct file_attr *fa,
const unsigned int at_flags);
-int
-xfrog_file_setattr(
- const int dfd,
- const char *path,
- const struct stat *stat,
- struct file_attr *fa,
- const unsigned int at_flags);
+int xfrog_file_setattr(const int dfd, const char *path, const mode_t mode,
+ struct file_attr *fa, const unsigned int at_flags);
#endif /* __LIBFROG_FILE_ATTR_H__ */
fa.fa_projid = 0;
fa.fa_xflags &= ~FS_XFLAG_PROJINHERIT;
- error = xfrog_file_setattr(dfd, path, stat, &fa, AT_SYMLINK_NOFOLLOW);
+ error = xfrog_file_setattr(dfd, path, stat->st_mode, &fa,
+ AT_SYMLINK_NOFOLLOW);
if (error) {
fprintf(stderr, _("%s: cannot clear project on %s: %s\n"),
progname, path, strerror(errno));
if (S_ISDIR(stat->st_mode))
fa.fa_xflags |= FS_XFLAG_PROJINHERIT;
- error = xfrog_file_setattr(dfd, path, stat, &fa, AT_SYMLINK_NOFOLLOW);
+ error = xfrog_file_setattr(dfd, path, stat->st_mode, &fa,
+ AT_SYMLINK_NOFOLLOW);
if (error) {
fprintf(stderr, _("%s: cannot set project on %s: %s\n"),
progname, path, strerror(errno));