• Home
  • History
  • Annotate
  • Raw
  • Download

Lines Matching refs:try

129   int (*callback)(struct dirtree *try);
143 int cp_node(struct dirtree *try) in cp_node() argument
145 int fdout = -1, cfd = try->parent ? try->parent->extra : AT_FDCWD, in cp_node()
146 tfd = dirtree_parentfd(try); in cp_node()
148 char *catch = try->parent ? try->name : TT.destname, *err = "%s"; in cp_node()
151 if (!dirtree_notdotdot(try)) return 0; in cp_node()
154 if (S_ISDIR(try->st.st_mode) && try->again) { in cp_node()
155 fdout = try->extra; in cp_node()
160 if (S_ISLNK(try->st.st_mode) && (flags & FLAG_d)) flags |= FLAG_r; in cp_node()
164 if ((TT.top.st_dev == try->st.st_dev && TT.top.st_ino == try->st.st_ino in cp_node()
166 || (!fstatat(cfd, catch, &cst, 0) && cst.st_dev == try->st.st_dev in cp_node()
167 && cst.st_ino == try->st.st_ino)) in cp_node()
169 error_msg("'%s' is '%s'", catch, err = dirtree_path(try, 0)); in cp_node()
180 if (S_ISDIR(try->st.st_mode)) { in cp_node()
181 error_msg("dir at '%s'", s = dirtree_path(try, 0)); in cp_node()
190 s = dirtree_path(try, 0)); in cp_node()
197 char *s = dirtree_path(try, 0); in cp_node()
209 if (S_ISDIR(try->st.st_mode)) { in cp_node()
214 catch = try->name; in cp_node()
225 if (!mkdirat(cfd, catch, try->st.st_mode | 0200) || errno == EEXIST) in cp_node()
226 if (-1 != (try->extra = openat(cfd, catch, O_NOFOLLOW))) in cp_node()
227 if (!fstat(try->extra, &st2) && S_ISDIR(st2.st_mode)) in cp_node()
234 if (!linkat(tfd, try->name, cfd, catch, 0)) err = 0; in cp_node()
244 s = dirtree_path(try, 0); in cp_node()
245 for (or = try; or->parent; or = or->parent) dotdots++; in cp_node()
264 } else if (!S_ISREG(try->st.st_mode) in cp_node()
265 && (try->parent || (flags & (FLAG_a|FLAG_r)))) in cp_node()
270 if (S_ISLNK(try->st.st_mode) in cp_node()
271 ? (0 < (i = readlinkat(tfd, try->name, toybuf, sizeof(toybuf))) && in cp_node()
273 : !mknodat(cfd, catch, try->st.st_mode, try->st.st_rdev)) in cp_node()
283 fdin = openat(tfd, try->name, O_RDONLY); in cp_node()
285 catch = try->name; in cp_node()
288 fdout = openat(cfd, catch, O_RDWR|O_CREAT|O_TRUNC, try->st.st_mode); in cp_node()
335 rc = fchownat(cfd, catch, try->st.st_uid, try->st.st_gid, in cp_node()
337 else rc = fchown(fdout, try->st.st_uid, try->st.st_gid); in cp_node()
341 perror_msg("chown '%s'", pp = dirtree_path(try, 0)); in cp_node()
348 struct timespec times[] = {try->st.st_atim, try->st.st_mtim}; in cp_node()
356 if (TT.pflags & _CP_mode) fchmod(fdout, try->st.st_mode); in cp_node()
361 if (unlinkat(tfd, try->name, S_ISDIR(try->st.st_mode) ? AT_REMOVEDIR :0)) in cp_node()
462 static int install_node(struct dirtree *try) in install_node() argument
464 try->st.st_mode = (TT.i.mode) in install_node()
465 ? string_to_mode(TT.i.mode, try->st.st_mode) : 0755; in install_node()
466 if (TT.i.group) try->st.st_gid = TT.gid; in install_node()
467 if (TT.i.user) try->st.st_uid = TT.uid; in install_node()
470 cp_node(try); in install_node()