[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [PATCH 2/7] Remove include lines for stubs.h from isys.



Ack. This looks good.

--
Martin Sivák
msivak redhat com
Red Hat Czech
Anaconda team / Brno, CZ

----- "David Cantrell" <dcantrell redhat com> wrote:

> The stubs.h header file does not exist anymore.  Replace gunzip_*
> macro usage with the real zlib function names.
> ---
>  loader/kbd.c           |   17 ++++++++---------
>  loader/lang.c          |    6 ++----
>  loader/loader.c        |    1 -
>  pyanaconda/isys/lang.c |   38 +++++++++++++++++++-------------------
>  4 files changed, 29 insertions(+), 33 deletions(-)
> 
> diff --git a/loader/kbd.c b/loader/kbd.c
> index c943be6..34cb29f 100644
> --- a/loader/kbd.c
> +++ b/loader/kbd.c
> @@ -34,7 +34,6 @@
>  #include "lang.h"
>  #include "windows.h"
>  
> -#include "../pyanaconda/isys/stubs.h"
>  #include "../pyanaconda/isys/lang.h"
>  #include "../pyanaconda/isys/log.h"
>  
> @@ -79,15 +78,15 @@ int chooseKeyboard(struct loaderData_s *
> loaderData, char ** kbdtypep) {
>      if (!defkbd)
>  	defkbd = "us";
>  
> -    f = gunzip_open("/etc/keymaps.gz");
> +    f = gzopen("/etc/keymaps.gz", "r");
>      if (!f) {
>  	errorWindow("cannot open /etc/keymaps.gz: %s");
>  	return LOADER_ERROR;
>      }
>  
> -    if (gunzip_read(f, &hdr, sizeof(hdr)) != sizeof(hdr)) {
> +    if (gzread(f, &hdr, sizeof(hdr)) != sizeof(hdr)) {
>  	errorWindow("failed to read keymaps header: %s");
> -	gunzip_close(f);
> +	gzclose(f);
>  	return LOADER_ERROR;
>      }
>  
> @@ -95,9 +94,9 @@ int chooseKeyboard(struct loaderData_s * loaderData,
> char ** kbdtypep) {
>  
>      i = hdr.numEntries * sizeof(*infoTable);
>      infoTable = alloca(i);
> -    if (gunzip_read(f, infoTable, i) != i) {
> +    if (gzread(f, infoTable, i) != i) {
>  	errorWindow("failed to read keymap information: %s");
> -	gunzip_close(f);
> +	gzclose(f);
>  	return LOADER_ERROR;
>      }
>  
> @@ -128,10 +127,10 @@ int chooseKeyboard(struct loaderData_s *
> loaderData, char ** kbdtypep) {
>      rc = 0;
>  
>      for (i = 0; i < num; i++) {
> -	if (gunzip_read(f, buf, infoTable[i].size) != infoTable[i].size) {
> +	if (gzread(f, buf, infoTable[i].size) != infoTable[i].size) {
>  	    logMessage(ERROR, "error reading %d bytes from file: %m",
>  		       infoTable[i].size);
> -	    gunzip_close(f);
> +	    gzclose(f);
>  	    rc = LOADER_ERROR;
>  	}
>      }
> @@ -145,7 +144,7 @@ int chooseKeyboard(struct loaderData_s *
> loaderData, char ** kbdtypep) {
>      if (rc != 0)
>  	rc = LOADER_ERROR;
>      else
> -        gunzip_close(f);
> +        gzclose(f);
>  
>      loaderData->kbd = strdup(infoTable[num].name);
>  
> diff --git a/loader/lang.c b/loader/lang.c
> index 0bb351e..035fb75 100644
> --- a/loader/lang.c
> +++ b/loader/lang.c
> @@ -40,8 +40,6 @@
>  #include "loadermisc.h"
>  #include "windows.h"
>  
> -#include "../pyanaconda/isys/stubs.h"
> -#include "../pyanaconda/isys/cpio.h"
>  #include "../pyanaconda/isys/lang.h"
>  #include "../pyanaconda/isys/isys.h"
>  #include "../pyanaconda/isys/log.h"
> @@ -161,7 +159,7 @@ void loadLanguage (char * file) {
>          sprintf(filename, "/etc/loader.tr");
>      }
>  
> -    stream = gunzip_open(file);
> +    stream = gzopen(file, "r");
>  
>      if (!stream) {
>          newtWinMessage("Error", "OK", "Translation for %s is not
> available.  "
> @@ -172,7 +170,7 @@ void loadLanguage (char * file) {
>      sprintf(filename, "%s.tr", key);
>  
>      rc = installCpioFile(stream, filename, "/tmp/translation", 1);
> -    gunzip_close(stream);
> +    gzclose(stream);
>  
>      if (rc || access("/tmp/translation", R_OK)) {
>          newtWinMessage("Error", "OK", "Cannot get translation file
> %s.\n", 
> diff --git a/loader/loader.c b/loader/loader.c
> index f9d5483..88d7a7a 100644
> --- a/loader/loader.c
> +++ b/loader/loader.c
> @@ -96,7 +96,6 @@
>  
>  #include "../pyanaconda/isys/imount.h"
>  #include "../pyanaconda/isys/isys.h"
> -#include "../pyanaconda/isys/stubs.h"
>  #include "../pyanaconda/isys/lang.h"
>  #include "../pyanaconda/isys/eddsupport.h"
>  #include "../pyanaconda/isys/log.h"
> diff --git a/pyanaconda/isys/lang.c b/pyanaconda/isys/lang.c
> index 19b98ea..0fa3d3c 100644
> --- a/pyanaconda/isys/lang.c
> +++ b/pyanaconda/isys/lang.c
> @@ -53,17 +53,17 @@ int isysLoadFont(void) {
>  #if defined (__s390__) || defined (__s390x__)
>      return 0;
>  #endif
> -    stream = gunzip_open("/etc/screenfont.gz");
> +    stream = gzopen("/etc/screenfont.gz", "r");
>      if (!stream)
>  	return -EACCES;
>  
> -    gunzip_read(stream, &cfo, sizeof(cfo));
> -    gunzip_read(stream, font, sizeof(font));
> -    gunzip_read(stream, map, sizeof(map));
> -    gunzip_read(stream, &d.entry_ct, sizeof(d.entry_ct));
> +    gzread(stream, &cfo, sizeof(cfo));
> +    gzread(stream, font, sizeof(font));
> +    gzread(stream, map, sizeof(map));
> +    gzread(stream, &d.entry_ct, sizeof(d.entry_ct));
>      d.entries = desc;
> -    gunzip_read(stream, desc, d.entry_ct * sizeof(desc[0]));
> -    gunzip_close(stream);
> +    gzread(stream, desc, d.entry_ct * sizeof(desc[0]));
> +    gzclose(stream);
>  
>      cfo.data = font;
>      cfo.op = KD_FONT_OP_SET;
> @@ -119,12 +119,12 @@ int loadKeymap(gzFile stream) {
>      if (major(sb.st_rdev) == 3 || major(sb.st_rdev) == 136)
>  	return 0;
>  
> -    if (gunzip_read(stream, &magic, sizeof(magic)) != sizeof(magic))
> +    if (gzread(stream, &magic, sizeof(magic)) != sizeof(magic))
>  	return -EIO;
>  
>      if (magic != KMAP_MAGIC) return -EINVAL;
>  
> -    if (gunzip_read(stream, keymaps, sizeof(keymaps)) !=
> sizeof(keymaps))
> +    if (gzread(stream, keymaps, sizeof(keymaps)) != sizeof(keymaps))
>  	return -EINVAL;
>  
>      console = open("/dev/tty0", O_RDWR);
> @@ -134,7 +134,7 @@ int loadKeymap(gzFile stream) {
>      for (kmap = 0; kmap < MAX_NR_KEYMAPS; kmap++) {
>  	if (!keymaps[kmap]) continue;
>  
> -	if (gunzip_read(stream, keymap, sizeof(keymap)) != sizeof(keymap))
> {
> +	if (gzread(stream, keymap, sizeof(keymap)) != sizeof(keymap)) {
>  	    close(console);
>  	    return -EIO;
>  	}
> @@ -166,18 +166,18 @@ int isysLoadKeymap(char * keymap) {
>      char buf[16384]; 			/* I hope this is big enough */
>      int i;
>  
> -    f = gunzip_open("/etc/keymaps.gz");
> +    f = gzopen("/etc/keymaps.gz", "r");
>      if (!f) return -EACCES;
>  
> -    if (gunzip_read(f, &hdr, sizeof(hdr)) != sizeof(hdr)) {
> -	gunzip_close(f);
> +    if (gzread(f, &hdr, sizeof(hdr)) != sizeof(hdr)) {
> +	gzclose(f);
>  	return -EINVAL;
>      }
>  
>      i = hdr.numEntries * sizeof(*infoTable);
>      infoTable = alloca(i);
> -    if (gunzip_read(f, infoTable, i) != i) {
> -	gunzip_close(f);
> +    if (gzread(f, infoTable, i) != i) {
> +	gzclose(f);
>  	return -EIO;
>      }
>  
> @@ -188,20 +188,20 @@ int isysLoadKeymap(char * keymap) {
>  	}
>  
>      if (num == -1) {
> -	gunzip_close(f);
> +	gzclose(f);
>  	return -ENOENT;
>      }
>  
>      for (i = 0; i < num; i++) {
> -	if (gunzip_read(f, buf, infoTable[i].size) != infoTable[i].size) {
> -	    gunzip_close(f);
> +	if (gzread(f, buf, infoTable[i].size) != infoTable[i].size) {
> +	    gzclose(f);
>  	    return -EIO;
>  	}
>      }
>  
>      rc = loadKeymap(f);
>  
> -    gunzip_close(f);
> +    gzclose(f);
>  
>      return rc;
>  }
> -- 
> 1.7.2.3
> 
> _______________________________________________
> Anaconda-devel-list mailing list
> Anaconda-devel-list redhat com
> https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]