wok diff linld/stuff/src/LOAD.CPP @ rev 20510

Up acl-dev (2.2.53)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Oct 31 15:13:42 2018 +0100 (2018-10-31)
parents 049ced0bd387
children f0d71e920c5a
line diff
     1.1 --- a/linld/stuff/src/LOAD.CPP	Fri Oct 26 10:09:53 2018 +0200
     1.2 +++ b/linld/stuff/src/LOAD.CPP	Wed Oct 31 15:13:42 2018 +0100
     1.3 @@ -145,11 +145,9 @@
     1.4     {
     1.5      u16 rm_seek;
     1.6  
     1.7 +do {
     1.8      // Do not use malloc below until heap_top adjustment (see <*>)
     1.9 -    if (read(m->fd, rm_buf, rm_seek=0x400) != 0x400) {
    1.10 -  readfail:
    1.11 -        die(kernel_file_error);
    1.12 -    }
    1.13 + if (read(m->fd, rm_buf, rm_seek=0x400) == 0x400) {
    1.14  
    1.15      if(kernelparams->setup_sects == 0) {
    1.16  #if 1
    1.17 @@ -170,8 +168,11 @@
    1.18  
    1.19      {
    1.20      u16 cnt = rm_size-rm_seek;
    1.21 -    if (read(m->fd, rm_buf+rm_seek, cnt) != cnt) goto readfail;
    1.22 +    if (read(m->fd, rm_buf+rm_seek, cnt) == cnt) break;
    1.23      }
    1.24 + }
    1.25 +        die(kernel_file_error);
    1.26 +} while (0);
    1.27     }
    1.28  
    1.29      // Tell rm loader some info