comparison src/main.c @ 11154:0895f142cac3 v8.0.0464

patch 8.0.0464: can't find executable name on Solaris and FreeBSD commit https://github.com/vim/vim/commit/f3757f0c87bbd52c7989c85dcbd21511bffcbdd6 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Mar 16 15:13:45 2017 +0100 patch 8.0.0464: can't find executable name on Solaris and FreeBSD Problem: Can't find executable name on Solaris and FreeBSD. Solution: Check for "/proc/self/path/a.out". (Danek Duvall) And for "/proc/curproc/file".
author Christian Brabandt <cb@256bit.org>
date Thu, 16 Mar 2017 15:15:05 +0100
parents 6f52cc87fe15
children 49fda934f7e8
comparison
equal deleted inserted replaced
11153:11200da8a321 11154:0895f142cac3
3537 static void 3537 static void
3538 set_progpath(char_u *argv0) 3538 set_progpath(char_u *argv0)
3539 { 3539 {
3540 char_u *val = argv0; 3540 char_u *val = argv0;
3541 3541
3542 # ifdef HAVE_PROC_SELF_EXE 3542 # ifdef PROC_EXE_LINK
3543 char buf[PATH_MAX + 1]; 3543 char buf[PATH_MAX + 1];
3544 ssize_t len; 3544 ssize_t len;
3545 3545
3546 len = readlink("/proc/self/exe", buf, PATH_MAX); 3546 len = readlink(PROC_EXE_LINK, buf, PATH_MAX);
3547 if (len > 0) 3547 if (len > 0)
3548 { 3548 {
3549 buf[len] = NUL; 3549 buf[len] = NUL;
3550 val = (char_u *)buf; 3550 val = (char_u *)buf;
3551 } 3551 }