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

linld: fix seekset link error
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Apr 08 12:48:12 2017 +0200 (2017-04-08)
parents 6f494adb2c71
children df6498976257
line diff
     1.1 --- a/linld/stuff/src/LOAD.CPP	Sun Mar 05 13:22:08 2017 +0100
     1.2 +++ b/linld/stuff/src/LOAD.CPP	Sat Apr 08 12:48:12 2017 +0200
     1.3 @@ -115,7 +115,6 @@
     1.4  u8 pm_high;	// @ = @rm_size + 2, see JUMP.ASM
     1.5  u8* rm_buf;	// @ = @rm_size + 3, see JUMP.ASM
     1.6  u32 base_himem = _1m+_64k;
     1.7 -extern struct image_himem pm, initrd;
     1.8  
     1.9  // register value to launch the kernel real mode code
    1.10  #ifdef NO386
    1.11 @@ -155,7 +154,7 @@
    1.12      if(kernelparams->setup_sects == 0) {
    1.13  #if 1
    1.14          if(* (int *) &first1k->pad10[0x3F-0x24] == 0x3AE8) {
    1.15 -            seekset(pm.fd,rm_seek=0x200);
    1.16 +            lseekset(pm.fd,rm_seek=0x200);
    1.17              csip+=0xFFE00042;
    1.18          }
    1.19          else
    1.20 @@ -246,12 +245,12 @@
    1.21  
    1.22  void load_initrd() {
    1.23      struct image_himem *m = &initrd;
    1.24 +    if (!initrd_name && !m->fd) return;
    1.25      m->errmsg = "Can't use initrd file";
    1.26 -    if (!initrd_name && !m->fd) return;
    1.27  
    1.28      open_image(initrd_name, m);
    1.29  
    1.30 -    if ((m->fallback=(memtop()-m->size)&(~PAGE_MASK)) < pm.fallback+pm.size) {
    1.31 +    if ((m->fallback=(memtop()-m->size)&(~PAGE_MASK)) < m[-1].fallback+m[-1].size) {
    1.32          close(m->fd);
    1.33          puts(m->errmsg);
    1.34          return;