Changeset 961


Ignore:
Timestamp:
May 27, 2007, 3:30:41 PM (18 years ago)
Author:
bird
Message:

find the executable on solaris. fixed bugs in the linux and freebsd code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/kbuild.c

    r949 r961  
    111111        rc = -1;
    112112    else
    113         szTmp[rc] == '\0';
     113        szTmp[rc] = '\0';
    114114
    115115#elif defined(__gnu_linux__) /** @todo find proper define... */
     
    118118        rc = -1;
    119119    else
    120         szTmp[rc] == '\0';
     120        szTmp[rc] = '\0';
    121121
    122122#elif defined(__OS2__)
    123      _execname(szTmp, GET_PATH_MAX);
    124      rc = 0;
    125 
     123    _execname(szTmp, GET_PATH_MAX);
     124    rc = 0;
     125
     126#elif defined(__sun__)
     127    {
     128        char szTmp2[64];
     129        snprintf(szTmp2, sizeof(szTmp2), "/proc/%d/path/a.out", getpid());
     130        rc = readlink(szTmp2, szTmp, GET_PATH_MAX - 1);
     131        if (rc < 0 || rc == GET_PATH_MAX - 1)
     132            rc = -1;
     133        else
     134            szTmp[rc] = '\0';
     135    }
     136   
    126137#elif defined(WINDOWS32)
    127138    if (GetModuleFileName(GetModuleHandle(NULL), szTmp, GET_PATH_MAX))
Note: See TracChangeset for help on using the changeset viewer.