Lines Matching refs:to_fd
807 int temp_fd, to_fd; in install() local
814 to_fd = -1; in install()
854 if ((to_fd = open(to_name, O_RDONLY, 0)) < 0) in install()
860 (size_t)from_sb.st_size, to_fd, in install()
865 (void)close(to_fd); in install()
869 to_fd = create_tempfile(to_name, tempfile, in install()
871 if (to_fd < 0) in install()
875 stripped = strip(tempfile, to_fd, from_name, in install()
879 digestresult = copy(from_fd, from_name, to_fd, in install()
887 (void)strip(tempfile, to_fd, NULL, &digestresult); in install()
893 close(to_fd); in install()
894 to_fd = open(tempfile, O_RDONLY, 0); in install()
895 if (to_fd < 0) in install()
903 temp_fd = to_fd; in install()
906 if ((to_fd = open(to_name, O_RDONLY, 0)) < 0) in install()
916 if (compare(temp_fd, tempfile, (size_t)temp_sb.st_size, to_fd, in install()
989 (void) close(to_fd); in install()
990 if ((to_fd = open(to_name, O_RDONLY, 0)) < 0) in install()
1003 if (fstat(to_fd, &to_sb) == -1) { in install()
1020 (void)fchflags(to_fd, to_sb.st_flags & ~NOCHANGEBITS); in install()
1026 if (fchown(to_fd, uid, gid) == -1) { in install()
1034 if (fchmod(to_fd, in install()
1052 fchflags(to_fd, in install()
1067 (void)close(to_fd); in install()
1083 int to_fd, const char *to_name __unused, size_t to_len, in compare() argument
1121 lseek(to_fd, 0, SEEK_SET); in compare()
1127 n2 = read(to_fd, buf2, n1); in compare()
1138 lseek(to_fd, 0, SEEK_SET); in compare()
1178 copy(int from_fd, const char *from_name, int to_fd, const char *to_name, in copy() argument
1193 if (lseek(to_fd, 0, SEEK_SET) < 0) in copy()
1200 ret = copy_file_range(from_fd, NULL, to_fd, NULL, in copy()
1231 if ((nw = write(to_fd, buf, nr)) != nr) { in copy()
1256 if (safecopy && fsync(to_fd) == -1) { in copy()
1274 strip(const char *to_name, int to_fd, const char *from_name, char **dresp) in strip() argument
1325 if (from_name != NULL && safecopy && fsync(to_fd) == -1) { in strip()