Lines Matching refs:newfd
342 int fd, newfd;
384 newfd = open(newpath, O_WRONLY|O_CREAT|O_EXCL, 0644);
385 if (newfd == -1) {
390 retval = copy_range(fd, 0, newfd, 0, st.st_size);
400 if (write_rec(newfd, rec, st.st_size) == -1) {
412 (void) close(newfd);
420 (void) close(newfd);
430 int fd, newfd;
503 newfd = open(newpath, O_WRONLY|O_CREAT|O_EXCL, 0644);
504 if (newfd == -1) {
509 retval = copy_range(fd, 0, newfd, 0, recoff);
513 retval = copy_range(fd, recnext, newfd, recoff, st.st_size - recnext);
523 if (write_rec(newfd, rec, st.st_size - (recnext - recoff)) == -1) {
532 (void) close(newfd);
540 (void) close(newfd);
550 int fd, newfd;
606 newfd = open(newpath, O_WRONLY|O_CREAT|O_EXCL, 0644);
607 if (newfd == -1) {
612 retval = copy_range(fd, 0, newfd, 0, recoff);
616 retval = copy_range(fd, recnext, newfd, recoff, st.st_size - recnext);
624 (void) close(newfd);
632 (void) close(newfd);