• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/file_cmds-242/install/

Lines Matching refs:to_fd

283 	int tempcopy, temp_fd, to_fd=0;
325 if ((to_fd = open(to_name, O_RDONLY, 0)) < 0)
331 (size_t)from_sb.st_size, to_fd,
336 (void)close(to_fd);
341 to_fd = create_tempfile(to_name, tempfile,
343 if (to_fd < 0)
346 if ((to_fd = create_newfile(to_name, target,
354 copy(from_fd, from_name, to_fd,
365 close(to_fd);
366 to_fd = open(tempcopy ? tempfile : to_name, O_RDONLY, 0);
367 if (to_fd < 0)
375 temp_fd = to_fd;
377 /* Re-open to_fd using the real target name. */
378 if ((to_fd = open(to_name, O_RDONLY, 0)) < 0)
388 if (compare(temp_fd, tempfile, (size_t)temp_sb.st_size, to_fd,
442 /* Re-open to_fd so we aren't hosed by the rename(2). */
443 (void) close(to_fd);
444 if ((to_fd = open(to_name, O_RDONLY, 0)) < 0)
451 fcopyfile(from_fd, to_fd, NULL, COPYFILE_XATTR) < 0) {
464 if (fstat(to_fd, &to_sb) == -1) {
480 (void)fchflags(to_fd, to_sb.st_flags & ~NOCHANGEBITS);
485 if (fchown(to_fd, uid, gid) == -1) {
493 if (fchmod(to_fd, mode)) {
507 if (!devnull && fchflags(to_fd,
523 (fcopyfile(from_fd, to_fd, NULL, COPYFILE_ACL) < 0)) {
528 (void)close(to_fd);
543 int to_fd, const char *to_name, size_t to_len)
555 if (trymmap(from_fd) && trymmap(to_fd)) {
559 q = mmap(NULL, from_len, PROT_READ, MAP_SHARED, to_fd, (off_t)0);
578 lseek(to_fd, 0, SEEK_SET);
584 n2 = read(to_fd, buf2, n1);
593 lseek(to_fd, 0, SEEK_SET);
669 copy(from_fd, from_name, to_fd, to_name, size)
670 register int from_fd, to_fd;
682 if (lseek(to_fd, (off_t)0, SEEK_SET) == (off_t)-1)
694 if ((nw = write(to_fd, p, size)) != size) {
704 if ((nw = write(to_fd, buf, nr)) != nr) {