Lines Matching refs:to_fd
74 int ch, checkch, from_fd, rval, to_fd;
123 to_fd = open(to.p_path, O_WRONLY | O_TRUNC, 0);
124 if (to_fd == -1) {
128 to_fd = open(to.p_path, O_WRONLY | O_TRUNC | O_CREAT,
137 to_fd = open(to.p_path, O_WRONLY | O_TRUNC | O_CREAT,
141 to_fd = open(to.p_path, O_WRONLY | O_TRUNC, 0);
144 to_fd = open(to.p_path, O_WRONLY | O_TRUNC | O_CREAT,
147 if (to_fd == -1) {
163 if (fstatfs(to_fd, &sfs) == 0 &&
172 (void) fcntl(to_fd, F_PREALLOCATE, &fst);
177 if (fstat(to_fd, &to_stat) != -1) {
180 && fchmod(to_fd, mode & ~(S_IRWXG|S_IRWXO))) {
204 wcount = write(to_fd, bufp, wresid);
234 wcount = write(to_fd, bufp, wresid);
266 if (fchmod(to_fd, mode))
271 if (fcopyfile(from_fd, to_fd, NULL, COPYFILE_XATTR) < 0)
274 if (pflag && setfile(fs, to_fd))
278 if (fcopyfile(from_fd, to_fd, NULL, COPYFILE_ACL) < 0)
282 if (pflag && setfile(fs, to_fd))
284 if (pflag && preserve_fd_acls(from_fd, to_fd) != 0)
288 if (close(to_fd)) {