[syslinux:master] gfxboot: remove save_read() function

syslinux-bot for Sebastian Herbszt herbszt at gmx.de
Fri Apr 1 13:09:07 PDT 2011


Commit-ID:  48802f81a520a9deda01840e0be280062071b27b
Gitweb:     http://syslinux.zytor.com/commit/48802f81a520a9deda01840e0be280062071b27b
Author:     Sebastian Herbszt <herbszt at gmx.de>
AuthorDate: Wed, 30 Mar 2011 23:09:32 +0200
Committer:  Sebastian Herbszt <herbszt at gmx.de>
CommitDate: Wed, 30 Mar 2011 23:09:32 +0200

gfxboot: remove save_read() function

Remove the no longer needed save_read() function.

Signed-off-by: Sebastian Herbszt <herbszt at gmx.de>


---
 com32/gfxboot/gfxboot.c |   26 ++------------------------
 1 files changed, 2 insertions(+), 24 deletions(-)

diff --git a/com32/gfxboot/gfxboot.c b/com32/gfxboot/gfxboot.c
index 37651fa..3749920 100644
--- a/com32/gfxboot/gfxboot.c
+++ b/com32/gfxboot/gfxboot.c
@@ -151,9 +151,6 @@ int timeout;
 
 char cmdline[MAX_CMDLINE_LEN];
 
-void *save_buf;
-unsigned save_buf_size;
-
 // progress bar is visible
 unsigned progress_active;
 
@@ -174,7 +171,6 @@ void gfx_infobox(int type, char *str1, char *str2);
 void gfx_progress_init(ssize_t kernel_size, char *label);
 void gfx_progress_update(ssize_t size);
 void gfx_progress_done(void);
-ssize_t save_read(int fd, void *buf, size_t size);
 void *load_one(char *file, ssize_t *file_size);
 void boot(int index);
 void boot_entry(menu_t *menu_ptr, char *arg);
@@ -214,9 +210,6 @@ int main(int argc, char **argv)
   gfx_config.sysconfig_size = sizeof gfx_config;
   gfx_config.bootloader_seg = 0;	// apparently not needed
 
-  save_buf_size = LOWMEM_BUF_SIZE;
-  save_buf = malloc(save_buf_size);
-
   if(argc < 2) {
     printf("Usage: gfxboot.c32 bootlogo_file [message_file]\n");
     if(argc > 2) show_message(argv[2]);
@@ -743,21 +736,6 @@ void gfx_progress_done(void)
 
 
 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-// Like read(2) but preserve lowmem buffer.
-//
-ssize_t save_read(int fd, void *buf, size_t size)
-{
-  ssize_t i;
-
-  memcpy(save_buf, lowmem_buf, save_buf_size);
-  i = read(fd, buf, size);
-  memcpy(lowmem_buf, save_buf, save_buf_size);
-
-  return i;
-}
-
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 // Read file and update progress bar.
 //
 void *load_one(char *file, ssize_t *file_size)
@@ -784,7 +762,7 @@ void *load_one(char *file, ssize_t *file_size)
   if(size) {
     buf = malloc(size);
     for(i = 1, cur = 0 ; cur < size && i > 0; cur += i) {
-      i = save_read(fd, buf + cur, min(CHUNK_SIZE, size - cur));
+      i = read(fd, buf + cur, min(CHUNK_SIZE, size - cur));
       if(i == -1) break;
       gfx_progress_update(i);
     }
@@ -792,7 +770,7 @@ void *load_one(char *file, ssize_t *file_size)
   else {
     do {
       buf = realloc(buf, size + CHUNK_SIZE);
-      i = save_read(fd, buf + size, CHUNK_SIZE);
+      i = read(fd, buf + size, CHUNK_SIZE);
       if(i == -1) break;
       size += i;
       gfx_progress_update(i);



More information about the Syslinux-commits mailing list