diff options
author | Erik Troan <ewt@redhat.com> | 2001-11-13 22:14:20 +0000 |
---|---|---|
committer | Erik Troan <ewt@redhat.com> | 2001-11-13 22:14:20 +0000 |
commit | 30b038644695e1e5c250bcce2821852b7c0d6f0d (patch) | |
tree | 4f157adf9af7ecbedf30554bf36562d9efa556ae /isys/gzlib | |
parent | 6564288e3bfaaf67cac90d6803c3ea8642cfe8d3 (diff) | |
download | anaconda-30b038644695e1e5c250bcce2821852b7c0d6f0d.tar.gz anaconda-30b038644695e1e5c250bcce2821852b7c0d6f0d.tar.xz anaconda-30b038644695e1e5c250bcce2821852b7c0d6f0d.zip |
added gunzip_dopen
Diffstat (limited to 'isys/gzlib')
-rw-r--r-- | isys/gzlib/binding.c | 15 | ||||
-rw-r--r-- | isys/gzlib/gzlib.h | 1 |
2 files changed, 11 insertions, 5 deletions
diff --git a/isys/gzlib/binding.c b/isys/gzlib/binding.c index ca93153a0..16dd568ad 100644 --- a/isys/gzlib/binding.c +++ b/isys/gzlib/binding.c @@ -9,16 +9,12 @@ struct gzFile_s { int fd; }; -gzFile gunzip_open(const char * file) { - int fd; +gzFile gunzip_dopen(int fd) { int p[2]; void * oldsig; pid_t child; gzFile str; - fd = open(file, O_RDONLY); - if (fd < 0) return NULL; - pipe(p); oldsig = signal(SIGCLD, SIG_IGN); @@ -46,6 +42,15 @@ gzFile gunzip_open(const char * file) { return str; } +gzFile gunzip_open(const char * file) { + int fd; + + fd = open(file, O_RDONLY); + if (fd < 0) return NULL; + + return gunzip_dopen(fd); +} + int gunzip_read(gzFile str, void * buf, int bytes) { int pos = 0; int i; diff --git a/isys/gzlib/gzlib.h b/isys/gzlib/gzlib.h index 5de4117d8..d44a37ea1 100644 --- a/isys/gzlib/gzlib.h +++ b/isys/gzlib/gzlib.h @@ -4,6 +4,7 @@ typedef struct gzFile_s * gzFile; gzFile gunzip_open(const char * file); +gzFile gunzip_dopen(int fd); int gunzip_read(gzFile str, void * buf, int bytes); int gunzip_close(gzFile str); |