3 /* copyout.c - create a cpio archive
4 Copyright (C) 1990, 1991, 1992, 2001, 2003, 2004 Free Software Foundation, Inc.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License along
17 with this program; if not, write to the Free Software Foundation, Inc.,
18 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
23 #include <sys/types.h>
25 #include "filetypes.h"
32 static int check_rdev ();
34 /* Read FILE_SIZE bytes of FILE_NAME from IN_FILE_DES and
35 compute and return a checksum for them. */
38 read_for_checksum (int in_file_des, int file_size, char *file_name)
48 for (bytes_left = file_size; bytes_left > 0; bytes_left -= bytes_read)
50 bytes_read = read (in_file_des, buf, BUFSIZ);
52 error (1, errno, _("cannot read checksum for %s"), file_name);
55 if (bytes_left < bytes_read)
56 bytes_read = bytes_left;
57 for (i = 0; i < bytes_read; ++i)
60 if (lseek (in_file_des, 0L, SEEK_SET))
61 error (1, errno, _("cannot read checksum for %s"), file_name);
66 /* Write out NULs to fill out the rest of the current block on
70 tape_clear_rest_of_block (int out_file_des)
72 while (output_size < io_block_size)
74 if ((io_block_size - output_size) > 512)
75 tape_buffered_write (zeros_512, out_file_des, 512);
77 tape_buffered_write (zeros_512, out_file_des, io_block_size - output_size);
81 /* Write NULs on OUT_FILE_DES to move from OFFSET (the current location)
82 to the end of the header. */
85 tape_pad_output (int out_file_des, int offset)
89 if (archive_format == arf_newascii || archive_format == arf_crcascii)
90 pad = (4 - (offset % 4)) % 4;
91 else if (archive_format == arf_tar || archive_format == arf_ustar)
92 pad = (512 - (offset % 512)) % 512;
93 else if (archive_format != arf_oldascii && archive_format != arf_hpoldascii)
94 pad = (2 - (offset % 2)) % 2;
99 tape_buffered_write (zeros_512, out_file_des, pad);
103 /* When creating newc and crc archives if a file has multiple (hard)
104 links, we don't put any of them into the archive until we have seen
105 all of them (or until we get to the end of the list of files that
106 are going into the archive and know that we have seen all of the links
107 to the file that we will see). We keep these "defered" files on
110 struct deferment *deferouts = NULL;
112 /* Count the number of other (hard) links to this file that have
113 already been defered. */
116 count_defered_links_to_dev_ino (struct new_cpio_header *file_hdr)
123 ino = file_hdr->c_ino;
124 maj = file_hdr->c_dev_maj;
125 min = file_hdr->c_dev_min;
127 for (d = deferouts; d != NULL; d = d->next)
129 if ( (d->header.c_ino == ino) && (d->header.c_dev_maj == maj)
130 && (d->header.c_dev_min == min) )
136 /* Is this file_hdr the last (hard) link to a file? I.e., have
137 we already seen and defered all of the other links? */
140 last_link (struct new_cpio_header *file_hdr)
142 int other_files_sofar;
144 other_files_sofar = count_defered_links_to_dev_ino (file_hdr);
145 if (file_hdr->c_nlink == (other_files_sofar + 1) )
153 /* Add the file header for a link that is being defered to the deferouts
157 add_link_defer (struct new_cpio_header *file_hdr)
160 d = create_deferment (file_hdr);
165 /* We are about to put a file into a newc or crc archive that is
166 multiply linked. We have already seen and defered all of the
167 other links to the file but haven't written them into the archive.
168 Write the other links into the archive, and remove them from the
172 writeout_other_defers (struct new_cpio_header *file_hdr, int out_des)
175 struct deferment *d_prev;
179 ino = file_hdr->c_ino;
180 maj = file_hdr->c_dev_maj;
181 min = file_hdr->c_dev_min;
186 if ( (d->header.c_ino == ino) && (d->header.c_dev_maj == maj)
187 && (d->header.c_dev_min == min) )
189 struct deferment *d_free;
190 d->header.c_filesize = 0;
191 write_out_header (&d->header, out_des);
193 d_prev->next = d->next;
198 free_deferment (d_free);
209 /* Write a file into the archive. This code is the same as
210 the code in process_copy_out(), but we need it here too
211 for writeout_final_defers() to call. */
214 writeout_defered_file (struct new_cpio_header *header, int out_file_des)
217 struct new_cpio_header file_hdr;
218 struct utimbuf times; /* For setting file times. */
219 /* Initialize this in case it has members we don't know to set. */
220 bzero (×, sizeof (struct utimbuf));
225 in_file_des = open (header->c_name,
226 O_RDONLY | O_BINARY, 0);
229 error (0, errno, "%s", header->c_name);
233 if (archive_format == arf_crcascii)
234 file_hdr.c_chksum = read_for_checksum (in_file_des,
238 write_out_header (&file_hdr, out_file_des);
239 copy_files_disk_to_tape (in_file_des, out_file_des, file_hdr.c_filesize, header->c_name);
240 warn_if_file_changed(header->c_name, file_hdr.c_filesize, file_hdr.c_mtime);
242 if (archive_format == arf_tar || archive_format == arf_ustar)
243 add_inode (file_hdr.c_ino, file_hdr.c_name, file_hdr.c_dev_maj,
246 tape_pad_output (out_file_des, file_hdr.c_filesize);
248 if (close (in_file_des) < 0)
249 error (0, errno, "%s", header->c_name);
252 times.actime = file_hdr.c_mtime;
253 times.modtime = file_hdr.c_mtime;
254 /* Debian hack: Silently ignore EROFS because reading the file
255 won't have upset its timestamp if it's on a read-only
256 filesystem. This has been submitted as a suggestion to
257 "bug-gnu-utils@prep.ai.mit.edu". -BEM */
258 if (utime (file_hdr.c_name, ×) < 0
260 error (0, errno, "%s", file_hdr.c_name);
265 /* When writing newc and crc format archives we defer multiply linked
266 files until we have seen all of the links to the file. If a file
267 has links to it that aren't going into the archive, then we will
268 never see the "last" link to the file, so at the end we just write
269 all of the leftover defered files into the archive. */
272 writeout_final_defers (int out_des)
276 while (deferouts != NULL)
279 other_count = count_defered_links_to_dev_ino (&d->header);
280 if (other_count == 1)
282 writeout_defered_file (&d->header, out_des);
286 struct new_cpio_header file_hdr;
287 file_hdr = d->header;
288 file_hdr.c_filesize = 0;
289 write_out_header (&file_hdr, out_des);
291 deferouts = deferouts->next;
296 /* Write out header FILE_HDR, including the file name, to file
297 descriptor OUT_DES. */
300 write_out_header (struct new_cpio_header *file_hdr, int out_des)
302 if (archive_format == arf_newascii || archive_format == arf_crcascii)
304 char ascii_header[112];
307 if (archive_format == arf_crcascii)
308 magic_string = "070702";
310 magic_string = "070701";
311 sprintf (ascii_header,
312 "%6s%08lx%08lx%08lx%08lx%08lx%08lx%08lx%08lx%08lx%08lx%08lx%08lx%08lx",
314 file_hdr->c_ino, file_hdr->c_mode, file_hdr->c_uid,
315 file_hdr->c_gid, file_hdr->c_nlink, file_hdr->c_mtime,
316 file_hdr->c_filesize, file_hdr->c_dev_maj, file_hdr->c_dev_min,
317 file_hdr->c_rdev_maj, file_hdr->c_rdev_min, file_hdr->c_namesize,
319 tape_buffered_write (ascii_header, out_des, 110L);
321 /* Write file name to output. */
322 tape_buffered_write (file_hdr->c_name, out_des, (long) file_hdr->c_namesize);
323 tape_pad_output (out_des, file_hdr->c_namesize + 110);
325 else if (archive_format == arf_oldascii || archive_format == arf_hpoldascii)
327 char ascii_header[78];
331 if (archive_format == arf_oldascii)
333 dev = makedev (file_hdr->c_dev_maj, file_hdr->c_dev_min);
334 rdev = makedev (file_hdr->c_rdev_maj, file_hdr->c_rdev_min);
338 /* HP/UX cpio creates archives that look just like ordinary archives,
339 but for devices it sets major = 0, minor = 1, and puts the
340 actual major/minor number in the filesize field. */
341 switch (file_hdr->c_mode & CP_IFMT)
351 file_hdr->c_filesize = makedev (file_hdr->c_rdev_maj,
352 file_hdr->c_rdev_min);
356 dev = makedev (file_hdr->c_dev_maj, file_hdr->c_dev_min);
357 rdev = makedev (file_hdr->c_rdev_maj, file_hdr->c_rdev_min);
362 if ((warn_option & CPIO_WARN_TRUNCATE) && (file_hdr->c_ino >> 16) != 0)
363 error (0, 0, _("%s: truncating inode number"), file_hdr->c_name);
365 /* Debian hack: The type of dev_t has changed in glibc. Fixed output
366 to ensure that a long int is passed to sprintf. This has been
367 reported to "bug-gnu-utils@prep.ai.mit.edu". (1998/5/26) -BEM */
368 sprintf (ascii_header,
369 "%06ho%06lo%06lo%06lo%06lo%06lo%06lo%06lo%011lo%06lo%011lo",
370 file_hdr->c_magic & 0xFFFF, (long) dev & 0xFFFF,
371 file_hdr->c_ino & 0xFFFF, file_hdr->c_mode & 0xFFFF,
372 file_hdr->c_uid & 0xFFFF, file_hdr->c_gid & 0xFFFF,
373 file_hdr->c_nlink & 0xFFFF, (long) rdev & 0xFFFF,
374 file_hdr->c_mtime, file_hdr->c_namesize & 0xFFFF,
375 file_hdr->c_filesize);
376 tape_buffered_write (ascii_header, out_des, 76L);
378 /* Write file name to output. */
379 tape_buffered_write (file_hdr->c_name, out_des, (long) file_hdr->c_namesize);
381 else if (archive_format == arf_tar || archive_format == arf_ustar)
383 write_out_tar_header (file_hdr, out_des);
387 struct old_cpio_header short_hdr;
389 short_hdr.c_magic = 070707;
390 short_hdr.c_dev = makedev (file_hdr->c_dev_maj, file_hdr->c_dev_min);
392 if ((warn_option & CPIO_WARN_TRUNCATE) && (file_hdr->c_ino >> 16) != 0)
393 error (0, 0, _("%s: truncating inode number"), file_hdr->c_name);
395 short_hdr.c_ino = file_hdr->c_ino & 0xFFFF;
396 short_hdr.c_mode = file_hdr->c_mode & 0xFFFF;
397 short_hdr.c_uid = file_hdr->c_uid & 0xFFFF;
398 short_hdr.c_gid = file_hdr->c_gid & 0xFFFF;
399 short_hdr.c_nlink = file_hdr->c_nlink & 0xFFFF;
400 if (archive_format != arf_hpbinary)
401 short_hdr.c_rdev = makedev (file_hdr->c_rdev_maj, file_hdr->c_rdev_min);
404 switch (file_hdr->c_mode & CP_IFMT)
406 /* HP/UX cpio creates archives that look just like ordinary
407 archives, but for devices it sets major = 0, minor = 1, and
408 puts the actual major/minor number in the filesize field. */
417 file_hdr->c_filesize = makedev (file_hdr->c_rdev_maj,
418 file_hdr->c_rdev_min);
419 short_hdr.c_rdev = makedev (0, 1);
422 short_hdr.c_rdev = makedev (file_hdr->c_rdev_maj,
423 file_hdr->c_rdev_min);
427 short_hdr.c_mtimes[0] = file_hdr->c_mtime >> 16;
428 short_hdr.c_mtimes[1] = file_hdr->c_mtime & 0xFFFF;
430 short_hdr.c_namesize = file_hdr->c_namesize & 0xFFFF;
432 short_hdr.c_filesizes[0] = file_hdr->c_filesize >> 16;
433 short_hdr.c_filesizes[1] = file_hdr->c_filesize & 0xFFFF;
435 /* Output the file header. */
436 tape_buffered_write ((char *) &short_hdr, out_des, 26L);
438 /* Write file name to output. */
439 tape_buffered_write (file_hdr->c_name, out_des, (long) file_hdr->c_namesize);
441 tape_pad_output (out_des, file_hdr->c_namesize + 26);
445 /* Read a list of file names from the standard input
446 and write a cpio collection on the standard output.
447 The format of the header depends on the compatibility (-c) flag. */
452 int res; /* Result of functions. */
453 dynamic_string input_name; /* Name of file read from stdin. */
454 struct utimbuf times; /* For resetting file times after copy. */
455 struct stat file_stat; /* Stat record for file. */
456 struct new_cpio_header file_hdr; /* Output header information. */
457 int in_file_des; /* Source file descriptor. */
458 int out_file_des; /* Output file descriptor. */
461 /* Initialize the copy out. */
462 ds_init (&input_name, 128);
463 /* Initialize this in case it has members we don't know to set. */
464 bzero (×, sizeof (struct utimbuf));
465 file_hdr.c_magic = 070707;
467 /* Check whether the output file might be a tape. */
468 out_file_des = archive_des;
469 if (_isrmt (out_file_des))
471 output_is_special = 1;
472 output_is_seekable = 0;
476 if (fstat (out_file_des, &file_stat))
477 error (1, errno, _("standard output is closed"));
480 S_ISBLK (file_stat.st_mode) ||
482 S_ISCHR (file_stat.st_mode);
483 output_is_seekable = S_ISREG (file_stat.st_mode);
489 prepare_append (out_file_des);
492 /* Copy files with names read from stdin. */
493 while (ds_fgetstr (stdin, &input_name, name_end) != NULL)
495 /* Check for blank line. */
496 if (input_name.ds_string[0] == 0)
498 error (0, 0, _("blank line ignored"));
502 /* Process next file. */
503 if ((*xstat) (input_name.ds_string, &file_stat) < 0)
504 error (0, errno, "%s", input_name.ds_string);
507 /* Set values in output header. */
508 file_hdr.c_dev_maj = major (file_stat.st_dev);
509 file_hdr.c_dev_min = minor (file_stat.st_dev);
510 file_hdr.c_ino = file_stat.st_ino;
511 /* For POSIX systems that don't define the S_IF macros,
512 we can't assume that S_ISfoo means the standard Unix
513 S_IFfoo bit(s) are set. So do it manually, with a
514 different name. Bleah. */
515 file_hdr.c_mode = (file_stat.st_mode & 07777);
516 if (S_ISREG (file_stat.st_mode))
517 file_hdr.c_mode |= CP_IFREG;
518 else if (S_ISDIR (file_stat.st_mode))
519 file_hdr.c_mode |= CP_IFDIR;
521 else if (S_ISBLK (file_stat.st_mode))
522 file_hdr.c_mode |= CP_IFBLK;
525 else if (S_ISCHR (file_stat.st_mode))
526 file_hdr.c_mode |= CP_IFCHR;
529 else if (S_ISFIFO (file_stat.st_mode))
530 file_hdr.c_mode |= CP_IFIFO;
533 else if (S_ISLNK (file_stat.st_mode))
534 file_hdr.c_mode |= CP_IFLNK;
537 else if (S_ISSOCK (file_stat.st_mode))
538 file_hdr.c_mode |= CP_IFSOCK;
541 else if (S_ISNWK (file_stat.st_mode))
542 file_hdr.c_mode |= CP_IFNWK;
544 file_hdr.c_uid = file_stat.st_uid;
545 file_hdr.c_gid = file_stat.st_gid;
546 file_hdr.c_nlink = file_stat.st_nlink;
548 /* The rdev is meaningless except for block and character
549 special files (POSIX standard) and perhaps fifos and
550 sockets. Clear it for other types of files so that
551 check_rdev() doesn't reject files just because stat()
552 put garbage in st_rdev and so that the output doesn't
553 depend on the garbage. */
554 switch (file_hdr.c_mode & CP_IFMT)
564 file_hdr.c_rdev_maj = major (file_stat.st_rdev);
565 file_hdr.c_rdev_min = minor (file_stat.st_rdev);
568 file_hdr.c_rdev_maj = 0;
569 file_hdr.c_rdev_min = 0;
573 file_hdr.c_mtime = file_stat.st_mtime;
574 file_hdr.c_filesize = file_stat.st_size;
575 file_hdr.c_chksum = 0;
576 file_hdr.c_tar_linkname = NULL;
578 if (archive_format == arf_tar || archive_format == arf_ustar)
580 if (file_hdr.c_mode & CP_IFDIR)
582 int len = strlen (input_name.ds_string);
583 /* Make sure the name ends with a slash */
584 if (input_name.ds_string[len-1] != '/')
586 ds_resize (&input_name, len + 2);
587 input_name.ds_string[len] = '/';
588 input_name.ds_string[len+1] = 0;
593 /* Strip leading `./' from the filename. */
594 p = input_name.ds_string;
595 while (*p == '.' && *(p + 1) == '/')
603 file_hdr.c_namesize = strlen (p) + 1;
605 if ( (archive_format != arf_tar) && (archive_format != arf_ustar) )
607 /* We mark CDF's in cpio files by adding a 2nd `/' after the
608 "hidden" directory name. We need to do this so we can
609 properly recreate the directory as hidden (in case the
610 files of a directory go into the archive before the
611 directory itself (e.g from "find ... -depth ... | cpio")). */
612 file_hdr.c_name = add_cdf_double_slashes (p);
613 file_hdr.c_namesize = strlen (file_hdr.c_name) + 1;
617 /* We don't mark CDF's in tar files. We assume the "hidden"
618 directory will always go into the archive before any of
621 file_hdr.c_namesize = strlen (p) + 1;
624 if ((archive_format == arf_tar || archive_format == arf_ustar)
625 && is_tar_filename_too_long (file_hdr.c_name))
627 error (0, 0, _("%s: file name too long"),
632 switch (check_rdev (&file_hdr))
635 error (0, 0, "%s not dumped: major number would be truncated",
639 error (0, 0, "%s not dumped: minor number would be truncated",
643 error (0, 0, "%s not dumped: device number would be truncated",
648 /* Copy the named file to the output. */
649 switch (file_hdr.c_mode & CP_IFMT)
652 if (archive_format == arf_tar || archive_format == arf_ustar)
655 if ((otherfile = find_inode_file (file_hdr.c_ino,
657 file_hdr.c_dev_min)))
659 file_hdr.c_tar_linkname = otherfile;
660 write_out_header (&file_hdr, out_file_des);
664 if ( (archive_format == arf_newascii || archive_format == arf_crcascii)
665 && (file_hdr.c_nlink > 1) )
667 if (last_link (&file_hdr) )
669 writeout_other_defers (&file_hdr, out_file_des);
673 add_link_defer (&file_hdr);
677 in_file_des = open (input_name.ds_string,
678 O_RDONLY | O_BINARY, 0);
681 error (0, errno, "%s", input_name.ds_string);
685 if (archive_format == arf_crcascii)
686 file_hdr.c_chksum = read_for_checksum (in_file_des,
688 input_name.ds_string);
690 write_out_header (&file_hdr, out_file_des);
691 copy_files_disk_to_tape (in_file_des, out_file_des, file_hdr.c_filesize, input_name.ds_string);
692 warn_if_file_changed(input_name.ds_string, file_hdr.c_filesize,
695 if (archive_format == arf_tar || archive_format == arf_ustar)
696 add_inode (file_hdr.c_ino, file_hdr.c_name, file_hdr.c_dev_maj,
699 tape_pad_output (out_file_des, file_hdr.c_filesize);
701 if (close (in_file_des) < 0)
702 error (0, errno, "%s", input_name.ds_string);
705 times.actime = file_stat.st_atime;
706 times.modtime = file_stat.st_mtime;
707 /* Debian hack: Silently ignore EROFS because
708 reading the file won't have upset its timestamp
709 if it's on a read-only filesystem. This has been
710 submitted as a suggestion to
711 "bug-gnu-utils@prep.ai.mit.edu". -BEM */
712 if (utime (file_hdr.c_name, ×) < 0
714 error (0, errno, "%s", file_hdr.c_name);
719 file_hdr.c_filesize = 0;
720 write_out_header (&file_hdr, out_file_des);
731 if (archive_format == arf_tar)
733 error (0, 0, _("%s not dumped: not a regular file"),
737 else if (archive_format == arf_ustar)
740 if ((otherfile = find_inode_file (file_hdr.c_ino,
742 file_hdr.c_dev_min)))
744 /* This file is linked to another file already in the
745 archive, so write it out as a hard link. */
746 file_hdr.c_mode = (file_stat.st_mode & 07777);
747 file_hdr.c_mode |= CP_IFREG;
748 file_hdr.c_tar_linkname = otherfile;
749 write_out_header (&file_hdr, out_file_des);
752 add_inode (file_hdr.c_ino, file_hdr.c_name,
753 file_hdr.c_dev_maj, file_hdr.c_dev_min);
755 file_hdr.c_filesize = 0;
756 write_out_header (&file_hdr, out_file_des);
762 char *link_name = (char *) xmalloc (file_stat.st_size + 1);
765 link_size = readlink (input_name.ds_string, link_name,
769 error (0, errno, "%s", input_name.ds_string);
773 file_hdr.c_filesize = link_size;
774 if (archive_format == arf_tar || archive_format == arf_ustar)
776 if (link_size + 1 > 100)
778 error (0, 0, _("%s: symbolic link too long"),
783 link_name[link_size] = '\0';
784 file_hdr.c_tar_linkname = link_name;
785 write_out_header (&file_hdr, out_file_des);
790 write_out_header (&file_hdr, out_file_des);
791 tape_buffered_write (link_name, out_file_des, link_size);
792 tape_pad_output (out_file_des, link_size);
800 error (0, 0, _("%s: unknown file type"), input_name.ds_string);
804 fprintf (stderr, "%s\n", input_name.ds_string);
810 writeout_final_defers(out_file_des);
811 /* The collection is complete; append the trailer. */
816 file_hdr.c_nlink = 1; /* Must be 1 for crc format. */
817 file_hdr.c_dev_maj = 0;
818 file_hdr.c_dev_min = 0;
819 file_hdr.c_rdev_maj = 0;
820 file_hdr.c_rdev_min = 0;
821 file_hdr.c_mtime = 0;
822 file_hdr.c_chksum = 0;
824 file_hdr.c_filesize = 0;
825 file_hdr.c_namesize = 11;
826 file_hdr.c_name = "TRAILER!!!";
827 if (archive_format != arf_tar && archive_format != arf_ustar)
828 write_out_header (&file_hdr, out_file_des);
831 tape_buffered_write (zeros_512, out_file_des, 512);
832 tape_buffered_write (zeros_512, out_file_des, 512);
835 /* Fill up the output block. */
836 tape_clear_rest_of_block (out_file_des);
837 tape_empty_output_buffer (out_file_des);
839 fputc ('\n', stderr);
842 res = (output_bytes + io_block_size - 1) / io_block_size;
843 fprintf (stderr, ngettext ("%d block\n", "%d blocks\n", res), res);
848 check_rdev (file_hdr)
849 struct new_cpio_header *file_hdr;
851 if (archive_format == arf_newascii || archive_format == arf_crcascii)
853 if ((file_hdr->c_rdev_maj & 0xFFFFFFFF) != file_hdr->c_rdev_maj)
855 if ((file_hdr->c_rdev_min & 0xFFFFFFFF) != file_hdr->c_rdev_min)
858 else if (archive_format == arf_oldascii || archive_format == arf_hpoldascii)
863 rdev = makedev (file_hdr->c_rdev_maj, file_hdr->c_rdev_min);
864 if (archive_format == arf_oldascii)
866 if ((rdev & 0xFFFF) != rdev)
871 switch (file_hdr->c_mode & CP_IFMT)
881 /* We could handle one more bit if longs are >= 33 bits. */
882 if ((rdev & 037777777777) != rdev)
886 if ((rdev & 0xFFFF) != rdev)
893 else if (archive_format == arf_tar || archive_format == arf_ustar)
895 /* The major and minor formats are limited to 7 octal digits in ustar
896 format, and to_oct () adds a gratuitous trailing blank to further
897 limit the format to 6 octal digits. */
898 if ((file_hdr->c_rdev_maj & 0777777) != file_hdr->c_rdev_maj)
900 if ((file_hdr->c_rdev_min & 0777777) != file_hdr->c_rdev_min)
908 rdev = makedev (file_hdr->c_rdev_maj, file_hdr->c_rdev_min);
909 if (archive_format != arf_hpbinary)
911 if ((rdev & 0xFFFF) != rdev)
916 switch (file_hdr->c_mode & CP_IFMT)
926 if ((rdev & 0xFFFFFFFF) != rdev)
928 file_hdr->c_filesize = rdev;
929 rdev = makedev (0, 1);
932 if ((rdev & 0xFFFF) != rdev)