diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2009-01-05 11:18:46 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2009-01-05 11:18:46 +0200 |
commit | 122e2d204e0bdcf081bf1bd05f410a6040a110bf (patch) | |
tree | 8172ee2f81bbd6e720625a727090bdc5ada06d18 /lib/header.c | |
parent | b0a4ff421bec790eaa3c16684e7ffcc49ac92314 (diff) | |
download | rpm-122e2d204e0bdcf081bf1bd05f410a6040a110bf.tar.gz rpm-122e2d204e0bdcf081bf1bd05f410a6040a110bf.tar.bz2 rpm-122e2d204e0bdcf081bf1bd05f410a6040a110bf.zip |
Eliminate header magic duplication all over the place, export it
- avoid several copies of the same thing...
- there are valid reasons for wanting to know header magic outside librpm,
export it as rpm_header_magic
Diffstat (limited to 'lib/header.c')
-rw-r--r-- | lib/header.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/header.c b/lib/header.c index afb9141f5..0d914de06 100644 --- a/lib/header.c +++ b/lib/header.c @@ -20,7 +20,7 @@ int _hdr_debug = 0; /** \ingroup header */ -static unsigned char const header_magic[8] = { +const unsigned char rpm_header_magic[8] = { 0x8e, 0xad, 0xe8, 0x01, 0x00, 0x00, 0x00, 0x00 }; @@ -235,7 +235,7 @@ unsigned headerSizeof(Header h, enum hMagic magicp) switch (magicp) { case HEADER_MAGIC_YES: - size += sizeof(header_magic); + size += sizeof(rpm_header_magic); break; case HEADER_MAGIC_NO: break; @@ -1053,7 +1053,7 @@ Header headerRead(FD_t fd, enum hMagic magicp) if (magicp == HEADER_MAGIC_YES) { magic = block[i++]; - if (memcmp(&magic, header_magic, sizeof(magic))) + if (memcmp(&magic, rpm_header_magic, sizeof(magic))) goto exit; reserved = block[i++]; } @@ -1101,8 +1101,8 @@ int headerWrite(FD_t fd, Header h, enum hMagic magicp) return 1; switch (magicp) { case HEADER_MAGIC_YES: - nb = Fwrite(header_magic, sizeof(char), sizeof(header_magic), fd); - if (nb != sizeof(header_magic)) + nb = Fwrite(rpm_header_magic, sizeof(uint8_t), sizeof(rpm_header_magic), fd); + if (nb != sizeof(rpm_header_magic)) goto exit; break; case HEADER_MAGIC_NO: |