Loading ...
Sorry, an error occurred while loading the content.

BUG: A little fix for x86_64 platform

Expand Messages
  • ZarathustraXYZ
    Hi all. I have found (and fixed) a little bug (in spawn.c file) that occurs with Linux kernel 2.6.x on 64bit platform. This occurs when you try to exec
    Message 1 of 3 , Oct 18, 2005
    View Source
    • 0 Attachment
      Hi all.
      I have found (and fixed) a little bug (in spawn.c file) that occurs
      with Linux kernel 2.6.x on 64bit platform. This occurs when you try
      to exec external tool like ctags, grep and so on.
      There are other little "fix": warning suppression, modified makefile
      for handle x86_64.

      Ciao.

      Vincenzo



      diff -ru me050505/src/input.c me050505_v/src/input.c
      --- me050505/src/input.c 2005-05-24 23:26:35.000000000 +0200
      +++ me050505_v/src/input.c 2005-10-15 00:14:19.000000000 +0200
      @@ -963,12 +963,12 @@
      ipos = ilen ;
      else
      {
      - ipos = (int) s1 - (int) buf + osdCol ;
      + ipos = ((int) (s1 - buf)) + osdCol ;
      if(ipos > ilen)
      ipos = ilen ;
      if(((s2 = meStrchr(s1,meCHAR_NL)) != NULL) &&
      - (((int) s2 - (int) buf) < ipos))
      - ipos = (int) s2 - (int) buf ;
      + (((int) (s2 - buf)) < ipos))
      + ipos = (int) (s2 - buf) ;
      }
      }
      else
      diff -ru me050505/src/linux26.gmk me050505_v/src/linux26.gmk
      --- me050505/src/linux26.gmk 2005-05-24 23:26:38.000000000 +0200
      +++ me050505_v/src/linux26.gmk 2005-10-18 22:07:56.000000000 +0200
      @@ -53,7 +53,13 @@
      LDOPTIMISE =
      LDFLAGS =
      LIBS =
      +
      +test = $(shell uname -m)
      +ifeq "$(test)" "x86_64"
      +WINDOW_LIBS = -L/usr/X11R6/lib64 -lX11
      +else
      WINDOW_LIBS = -L/usr/X11R6/lib -lX11
      +endif
      #
      # figure out if termcap is avaiable or if ncurses should be tried
      to
      # accomplish this try to compile test.c and see if it can link
      termcap. For
      diff -ru me050505/src/osd.c me050505_v/src/osd.c
      --- me050505/src/osd.c 2005-05-24 23:26:35.000000000 +0200
      +++ me050505_v/src/osd.c 2005-10-14 23:59:06.000000000 +0200
      @@ -1664,7 +1664,7 @@
      s1 = meStrchr(ss,meCHAR_NL) ;
      s2 = ss ;
      start = 0 ;
      - while((s1 != NULL) && ((len=((int) s1 - (int) s2)) < cpos))
      + while((s1 != NULL) && ((len = ((int) (s1 - s2))) < cpos))
      {
      start++ ;
      s2 = s1+1 ;
      @@ -1693,7 +1693,7 @@
      while(--row >= 0)
      {
      s2 = meStrchr(s1,meCHAR_NL) ;
      - len = ((int) s2 - (int) s1) ;
      + len = (int) (s2 - s1) ;
      osdRenderEntryLine(txtp,s1,len,0,ww) ;
      txtp += totWidth ;
      s1 = s2 + 1 ;
      @@ -1702,7 +1702,7 @@
      if(s2 == NULL)
      len = -1 ;
      else
      - len = ((int) s2 - (int) s1) ;
      + len = (int) (s2 - s1) ;
      col = osdRenderEntryLine(txtp,s1,len,cpos,ww) ;
      while(--dd >= 0)
      {
      @@ -1716,7 +1716,7 @@
      if(s2 == NULL)
      len = -1 ;
      else
      - len = ((int) s2 - (int) s1) ;
      + len = (int) (s2 - s1) ;
      }
      osdRenderEntryLine(txtp,s1,len,0,ww) ;
      }
      diff -ru me050505/src/spawn.c me050505_v/src/spawn.c
      --- me050505/src/spawn.c 2005-05-24 23:26:35.000000000 +0200
      +++ me050505_v/src/spawn.c 2005-10-15 00:11:22.000000000 +0200
      @@ -49,6 +49,12 @@
      #include <sgtty.h> /* For stty/gtty functions
      */
      #endif /* _BSD */

      +#ifdef _LINUX26
      +extern int grantpt(int);
      +extern int unlockpt(int);
      +extern char *ptsname(int);
      +#endif
      +
      #ifdef _SUNOS
      #include <stropts.h>
      #endif
      @@ -1982,7 +1988,7 @@
      ss = comStr + ll ;
      }
      else
      - ll = (int) ss - (int) comStr ;
      + ll = (int) (ss - comStr) ;

      meStrncpy(line,comStr,ll) ;
      line[ll] = '\0' ;
    • Jon Green
      ... Hi Vincenzo, I think you are the first to attempt to build a 64-bit Linux image. Looking through your changes, certainly a little bit cleaner - probably
      Message 2 of 3 , Oct 18, 2005
      View Source
      • 0 Attachment
        ZarathustraXYZ wrote:
        > Hi all.
        > I have found (and fixed) a little bug (in spawn.c file) that occurs
        > with Linux kernel 2.6.x on 64bit platform. This occurs when you try
        > to exec external tool like ctags, grep and so on.
        > There are other little "fix": warning suppression, modified makefile
        > for handle x86_64.
        >
        > Ciao.
        >
        > Vincenzo

        Hi Vincenzo,

        I think you are the first to attempt to build a 64-bit Linux image.
        Looking through your changes, certainly a little bit cleaner - probably
        the way it should have been in the first case.

        Thanks.
        Jon.
      • ZarathustraXYZ
        Hi Jon, thanks for your great work. Microemacs is a very good editor. I have been using it for more than 3 years on i686, on Alpha ( :-) ) and now on AMD64. I
        Message 3 of 3 , Oct 19, 2005
        View Source
        • 0 Attachment
          Hi Jon,
          thanks for your great work. Microemacs is a very good editor. I have
          been using it for more than 3 years on i686, on Alpha ( :-) ) and now
          on AMD64. I don't know exactly why but on Alpha (with Linux kernel 2.
          4.x, gcc 2.96 and Compaq ccc) it seems it's working, that's why I have
          never realized that there could be such kind of problems.
          I think I may have found others little problems and we'll talk about
          them next time.

          Ciao.
          Vincenzo.



          --- In jasspa@yahoogroups.com, Jon Green <jon@j...> wrote:
          >
          > ZarathustraXYZ wrote:
          > > Hi all.
          > > I have found (and fixed) a little bug (in spawn.c file) that
          occurs
          > > with Linux kernel 2.6.x on 64bit platform. This occurs when you
          try
          > > to exec external tool like ctags, grep and so on.
          > > There are other little "fix": warning suppression, modified
          makefile
          > > for handle x86_64.
          > >
          > > Ciao.
          > >
          > > Vincenzo
          >
          > Hi Vincenzo,
          >
          > I think you are the first to attempt to build a 64-bit Linux image.
          > Looking through your changes, certainly a little bit cleaner -
          probably
          > the way it should have been in the first case.
          >
          > Thanks.
          > Jon.
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.