summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Troan <ewt@redhat.com>1999-12-06 22:52:00 +0000
committerErik Troan <ewt@redhat.com>1999-12-06 22:52:00 +0000
commit84cda6e181709f2fd710d024a1839ee75cdf4bf6 (patch)
tree2aef301ad080526da27c6f2b2e9c2154e549fa24
parenta6a936cd47987d7cc533a77dcd363216aa8050e1 (diff)
downloadanaconda-84cda6e181709f2fd710d024a1839ee75cdf4bf6.tar.gz
anaconda-84cda6e181709f2fd710d024a1839ee75cdf4bf6.tar.xz
anaconda-84cda6e181709f2fd710d024a1839ee75cdf4bf6.zip
updated for new rpmio stuff
-rw-r--r--utils/genhdlist.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/utils/genhdlist.c b/utils/genhdlist.c
index e2f643ca8..da7128c4a 100644
--- a/utils/genhdlist.c
+++ b/utils/genhdlist.c
@@ -62,7 +62,7 @@ int main(int argc, char ** argv) {
unlink(buf);
- outfd = fdio->_open(buf, O_WRONLY | O_TRUNC | O_CREAT, 0644);
+ outfd = Fopen(buf, "w");
if (!outfd) {
fprintf(stderr,"error creating file %s: %s\n", buf, strerror(errno));
return 1;
@@ -78,14 +78,17 @@ int main(int argc, char ** argv) {
while (ent) {
int i = strlen (ent->d_name);
if (i > 4 && strcasecmp (&ent->d_name [i - 4], ".rpm") == 0) {
- fd = fdio->_open(ent->d_name, O_RDONLY, 0666);
+ fd = Fopen(ent->d_name, "r");
if (!fd) {
perror("open");
exit(1);
}
- fstat(fdio->_fileno(fd), &sb);
+ if (stat(ent->d_name, &sb)) {
+ perror("stat");
+ exit(1);
+ }
size = sb.st_size;
rc = rpmReadPackageHeader(fd, &h, &isSource, NULL, NULL);