*
* Likewise for the mtime (which happens to use a buffer of the same size).
*/
+#if ULONG_MAX == 0xFFFFFFFF
+#define USTAR_MAX_SIZE ULONG_MAX
+#define USTAR_MAX_MTIME ULONG_MAX
+#else
#define USTAR_MAX_SIZE 077777777777UL
#define USTAR_MAX_MTIME 077777777777UL
+#endif
/* writes out the whole block, but only if it is full */
static void write_if_needed(void)
return err;
}
-static int write_global_extended_header(struct archiver_args *args)
+static void write_global_extended_header(struct archiver_args *args)
{
const unsigned char *sha1 = args->commit_sha1;
struct strbuf ext_header = STRBUF_INIT;
struct ustar_header header;
unsigned int mode;
- int err = 0;
if (sha1)
strbuf_append_ext_header(&ext_header, "comment",
}
if (!ext_header.len)
- return 0;
+ return;
memset(&header, 0, sizeof(header));
*header.typeflag = TYPEFLAG_GLOBAL_HEADER;
write_blocked(&header, sizeof(header));
write_blocked(ext_header.buf, ext_header.len);
strbuf_release(&ext_header);
- return err;
}
static struct archiver **tar_filters;
{
int err = 0;
- err = write_global_extended_header(args);
- if (!err)
- err = write_archive_entries(args, write_tar_entry);
+ write_global_extended_header(args);
+ err = write_archive_entries(args, write_tar_entry);
if (!err)
write_trailer();
return err;