use writeLead() from librpm
authormarc <devnull@localhost>
Fri, 5 Jan 1996 03:13:40 +0000 (03:13 +0000)
committermarc <devnull@localhost>
Fri, 5 Jan 1996 03:13:40 +0000 (03:13 +0000)
CVS patchset: 130
CVS date: 1996/01/05 03:13:40

build/pack.c

index 5fc2d76..c5b928e 100644 (file)
@@ -50,20 +50,15 @@ static int writeMagic(Spec s, struct PackageRec *pr,
 {
     struct rpmlead lead;
 
-    lead.magic[0] = RPMLEAD_MAGIC0;
-    lead.magic[1] = RPMLEAD_MAGIC1;
-    lead.magic[2] = RPMLEAD_MAGIC2;
-    lead.magic[3] = RPMLEAD_MAGIC3;
-
     lead.major = 2;
     lead.minor = 0;
-    lead.type = htons(type);
-    lead.archnum = htons(getArchNum());
-    lead.osnum = htons(getOsNum());
-    lead.signature_type = htons(RPMLEAD_SIGNONE);
+    lead.type = type;
+    lead.archnum = getArchNum();
+    lead.osnum = getOsNum();
+    lead.signature_type = RPMLEAD_SIGNONE;
     strncpy(lead.name, name, sizeof(lead.name));
 
-    write(fd, &lead, sizeof(lead));
+    writeLead(fd, &lead);
 
     return 0;
 }