From: Tilman Sauerbeck Date: Fri, 29 Dec 2006 15:51:27 +0000 (+0100) Subject: Removed some dead (and buggy) code. X-Git-Url: http://gitweb/?a=commitdiff_plain;h=9fb2521b153582faf2d79e29f44421d34c2b6ae1;p=pkgutils-cross.git Removed some dead (and buggy) code. --- diff --git a/pkgutil.cc b/pkgutil.cc index 62a9edf..943c420 100644 --- a/pkgutil.cc +++ b/pkgutil.cc @@ -38,7 +38,6 @@ #include #include #include -#include #include #include #include @@ -699,42 +698,6 @@ string mtos(mode_t mode) return s; } -int unistd_gzopen(char* pathname, int flags, mode_t mode) -{ - char* gz_mode; - - switch (flags & O_ACCMODE) { - case O_WRONLY: - gz_mode = "w"; - break; - - case O_RDONLY: - gz_mode = "r"; - break; - - case O_RDWR: - default: - errno = EINVAL; - return -1; - } - - int fd; - gzFile gz_file; - - if ((fd = open(pathname, flags, mode)) == -1) - return -1; - - if ((flags & O_CREAT) && fchmod(fd, mode)) - return -1; - - if (!(gz_file = gzdopen(fd, gz_mode))) { - errno = ENOMEM; - return -1; - } - - return (int)gz_file; -} - string trim_filename(const string& filename) { string search("//"); diff --git a/pkgutil.h b/pkgutil.h index 03409df..d950352 100644 --- a/pkgutil.h +++ b/pkgutil.h @@ -99,7 +99,6 @@ public: void assert_argument(char** argv, int argc, int index); string itos(unsigned int value); string mtos(mode_t mode); -int unistd_gzopen(char* pathname, int flags, mode_t mode); string trim_filename(const string& filename); bool file_exists(const string& filename); bool file_empty(const string& filename);