Lines Matching refs:arfd

74 static int arfd = -1;			/* archive file descriptor */
106 if (arfd != -1)
107 (void)close(arfd);
108 arfd = -1;
120 arfd = STDIN_FILENO;
122 } else if ((arfd = open(name, EXT_MODE, DMOD)) < 0)
124 if (arfd != -1 && gzip_program != NULL)
125 ar_start_gzip(arfd, gzip_program, 0);
129 arfd = STDOUT_FILENO;
131 } else if ((arfd = open(name, AR_MODE, DMOD)) < 0)
135 if (arfd != -1 && gzip_program != NULL)
136 ar_start_gzip(arfd, gzip_program, 1);
140 arfd = STDOUT_FILENO;
142 } else if ((arfd = open(name, APP_MODE, DMOD)) < 0)
148 * arfd not used in COPY mode
154 if (arfd < 0)
165 if (fstat(arfd, &arsb) < 0) {
167 (void)close(arfd);
168 arfd = -1;
175 (void)close(arfd);
176 arfd = -1;
182 artyp = ioctl(arfd, MTIOCGET, &mb) ? ISCHR : ISTAPE;
185 else if ((lseek(arfd, (off_t)0L, SEEK_CUR) == -1) && (errno == ESPIPE))
307 if (arfd < 0) {
331 if (can_unlnk && (fstat(arfd, &arsb) == 0) && (S_ISREG(arsb.st_mode)) &&
344 (void)close(arfd);
355 arfd = -1;
442 while ((res = read(arfd, drbuf, sizeof(drbuf))) > 0)
478 if (((cpos = lseek(arfd, (off_t)0L, SEEK_CUR)) < 0) ||
479 (ftruncate(arfd, cpos) < 0)) {
535 if ((res = read(arfd, buf, cnt)) > 0) {
573 if ((res = read(arfd, buf, cnt)) > 0) {
615 if ((res = write(arfd, buf, bsz)) == bsz) {
637 if ((cpos = lseek(arfd, (off_t)0L, SEEK_CUR)) < 0)
640 if (ftruncate(arfd, cpos) < 0)
760 if (ioctl(arfd, MTIOCTOP, &mb) < 0)
773 if ((cpos = lseek(arfd, (off_t)0L, SEEK_CUR)) < 0)
776 if (lseek(arfd, mpos, SEEK_CUR) < 0)
834 if ((cpos = lseek(arfd, (off_t)0L, SEEK_CUR)) >= 0) {
846 if (lseek(arfd, mpos, SEEK_SET) >= 0)
902 if ((cpos = lseek(arfd, (off_t)0L, SEEK_CUR)) < 0) {
927 if (lseek(arfd, cpos, SEEK_SET) < 0) {
974 if (ioctl(arfd, MTIOCTOP, &mb) < 0) {
1015 while ((res = read(arfd, scbuf, sizeof(scbuf))) > 0)
1029 if (ioctl(arfd, MTIOCTOP, &mb) < 0) {
1040 if (ioctl(arfd, MTIOCTOP, &mb) < 0) {
1044 if ((phyblk = read(arfd, scbuf, sizeof(scbuf))) <= 0) {
1053 while ((res = read(arfd, scbuf, sizeof(scbuf))) > 0)
1061 if (ioctl(arfd, MTIOCTOP, &mb) < 0) {
1092 if (ioctl(arfd, MTIOCTOP, &mb) < 0) {