5 extern void check_header_gzip(int src_fd)
13 unsigned char xtra_flags;
14 unsigned char os_flags;
18 xread_all(src_fd, header.raw, 8);
20 /* Check the compression method */
21 if (header.formated.method != 8) {
22 error_msg_and_die("Unknown compression method %d",
23 header.formated.method);
26 if (header.formated.flags & 0x04) {
27 /* bit 2 set: extra field present */
28 unsigned char extra_short;
30 extra_short = xread_char(src_fd);
31 extra_short += xread_char(src_fd) << 8;
32 while (extra_short > 0) {
33 /* Ignore extra field */
39 /* Discard original name if any */
40 if (header.formated.flags & 0x08) {
41 /* bit 3 set: original file name present */
45 read(src_fd, &tmp, 1);
49 /* Discard file comment if any */
50 if (header.formated.flags & 0x10) {
51 /* bit 4 set: file comment present */
55 read(src_fd, &tmp, 1);
59 /* Read the header checksum */
60 if (header.formated.flags & 0x02) {
63 read(src_fd, &tmp, 1);
64 read(src_fd, &tmp, 1);