diff options
author | Erik Troan <ewt@redhat.com> | 1999-12-06 22:52:00 +0000 |
---|---|---|
committer | Erik Troan <ewt@redhat.com> | 1999-12-06 22:52:00 +0000 |
commit | 84cda6e181709f2fd710d024a1839ee75cdf4bf6 (patch) | |
tree | 2aef301ad080526da27c6f2b2e9c2154e549fa24 | |
parent | a6a936cd47987d7cc533a77dcd363216aa8050e1 (diff) | |
download | anaconda-84cda6e181709f2fd710d024a1839ee75cdf4bf6.tar.gz anaconda-84cda6e181709f2fd710d024a1839ee75cdf4bf6.tar.xz anaconda-84cda6e181709f2fd710d024a1839ee75cdf4bf6.zip |
updated for new rpmio stuff
-rw-r--r-- | utils/genhdlist.c | 9 |
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); |