aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-02-27 20:42:29 +0000
committerThierry Vignaud <tv@mageia.org>2012-02-27 20:42:29 +0000
commit537924b2bc2df70bd255d407529121776395ba79 (patch)
tree23f8c88174afec07d0dfb95d023835c8eca9abaa
parentc4a297bd12c87bf2a5eaaaa3d259dc8f03b6a0a7 (diff)
downloadperl-URPM-537924b2bc2df70bd255d407529121776395ba79.tar
perl-URPM-537924b2bc2df70bd255d407529121776395ba79.tar.gz
perl-URPM-537924b2bc2df70bd255d407529121776395ba79.tar.bz2
perl-URPM-537924b2bc2df70bd255d407529121776395ba79.tar.xz
perl-URPM-537924b2bc2df70bd255d407529121776395ba79.zip
(update_header) explain what are magic numbers
-rw-r--r--URPM.xs2
1 files changed, 2 insertions, 0 deletions
diff --git a/URPM.xs b/URPM.xs
index 44b87b4..4cac2d2 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -1176,6 +1176,7 @@ update_header(char *filename, URPM__Package pkg, __attribute__((unused)) int kee
if (read(d, &sig, sizeof(sig)) == sizeof(sig)) {
lseek(d, 0, SEEK_SET);
+ // Is it RPM lead?
if (sig[0] == 0xed && sig[1] == 0xab && sig[2] == 0xee && sig[3] == 0xdb) {
FD_t fd = fdDup(d);
Header header;
@@ -1198,6 +1199,7 @@ update_header(char *filename, URPM__Package pkg, __attribute__((unused)) int kee
}
(void)rpmtsFree(ts);
} else if (sig[0] == 0x8e && sig[1] == 0xad && sig[2] == 0xe8 && sig[3] == 0x01) {
+ // or is it RPM header magic?
FD_t fd = fdDup(d);
close(d);