Check for write errors

CVS patchset: 1865
CVS date: 1997/10/17 18:12:09
This commit is contained in:
marc 1997-10-17 18:12:09 +00:00
parent deaf96073e
commit 99d07c6e20
1 changed files with 3 additions and 1 deletions

View File

@ -32,7 +32,9 @@ int writeLead(int fd, struct rpmlead *lead)
l.osnum = htons(l.osnum);
l.signature_type = htons(l.signature_type);
write(fd, &l, sizeof(l));
if (write(fd, &l, sizeof(l)) < 0) {
return 1;
}
return 0;
}