@matheusbsbs / matheus-bagliano / commits / c90be46abd
Fork 0

Changed fast-import's pack header creation to use pack.h

Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

Shawn O. Pearce committed Aug 16, 2006 at 01:57 UTC c90be46abdbd102ab8e9af0303d33976d552ae58
1 file changed +8 -9
fast-import.c
+8 -9
@@ -800,15 +800,14 @@ del_entry:
800
801 static void init_pack_header()
802 {
803 - const char* magic = "PACK";
804 - unsigned long version = 3;
805 - unsigned long zero = 0;
806 -
807 - version = htonl(version);
808 - ywrite(pack_fd, (char*)magic, 4);
809 - ywrite(pack_fd, &version, 4);
810 - ywrite(pack_fd, &zero, 4);
811 - pack_offset = 4 * 3;
803 + struct pack_header hdr;
804 +
805 + hdr.hdr_signature = htonl(PACK_SIGNATURE);
806 + hdr.hdr_version = htonl(2);
807 + hdr.hdr_entries = 0;
808 +
809 + ywrite(pack_fd, &hdr, sizeof(hdr));
810 + pack_offset = sizeof(hdr);
811 }
812
813 static void fixup_header_footer()