To: vim_dev@googlegroups.com Subject: Patch 8.0.0464 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.0464 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". Files: src/config.h.in, src/configure.ac, src/main.c, src/auto/configure *** ../vim-8.0.0463/src/config.h.in 2017-03-12 18:37:58.375653719 +0100 --- src/config.h.in 2017-03-16 14:26:46.325148353 +0100 *************** *** 446,453 **** /* Define if fcntl()'s F_SETFD command knows about FD_CLOEXEC */ #undef HAVE_FD_CLOEXEC ! /* Define if /proc/self/exe can be read */ ! #undef HAVE_PROC_SELF_EXE /* Define if you want Cygwin to use the WIN32 clipboard, not compatible with X11*/ #undef FEAT_CYGWIN_WIN32_CLIPBOARD --- 446,453 ---- /* Define if fcntl()'s F_SETFD command knows about FD_CLOEXEC */ #undef HAVE_FD_CLOEXEC ! /* Define if /proc/self/exe or similar can be read */ ! #undef PROC_EXE_LINK /* Define if you want Cygwin to use the WIN32 clipboard, not compatible with X11*/ #undef FEAT_CYGWIN_WIN32_CLIPBOARD *** ../vim-8.0.0463/src/configure.ac 2017-03-11 20:03:37.837266860 +0100 --- src/configure.ac 2017-03-16 14:32:04.578824782 +0100 *************** *** 3020,3031 **** dnl end of GUI-checking dnl --------------------------------------------------------------------------- ! AC_MSG_CHECKING([for /proc/self/exe]) if test -L "/proc/self/exe"; then ! AC_MSG_RESULT(yes) ! AC_DEFINE(HAVE_PROC_SELF_EXE) else ! AC_MSG_RESULT(no) fi dnl Check for Cygwin, which needs an extra source file if not using X11 --- 3020,3040 ---- dnl end of GUI-checking dnl --------------------------------------------------------------------------- ! AC_MSG_CHECKING([for /proc link to executable]) if test -L "/proc/self/exe"; then ! dnl Linux ! AC_MSG_RESULT([/proc/self/exe]) ! AC_DEFINE(PROC_EXE_LINK, "/proc/self/exe") ! elif test -L "/proc/self/path/a.out"; then ! dnl Solaris ! AC_MSG_RESULT([/proc/self/path/a.out]) ! AC_DEFINE(PROC_EXE_LINK, "/proc/self/path/a.out") ! elif test -L "/proc/curproc/file"; then ! dnl FreeBSD ! AC_MSG_RESULT([/proc/curproc/file]) ! AC_DEFINE(PROC_EXE_LINK, "/proc/curproc/file") else ! AC_MSG_RESULT(no) fi dnl Check for Cygwin, which needs an extra source file if not using X11 *** ../vim-8.0.0463/src/main.c 2017-03-12 18:37:58.375653719 +0100 --- src/main.c 2017-03-16 14:32:36.842589285 +0100 *************** *** 3539,3549 **** { char_u *val = argv0; ! # ifdef HAVE_PROC_SELF_EXE char buf[PATH_MAX + 1]; ssize_t len; ! len = readlink("/proc/self/exe", buf, PATH_MAX); if (len > 0) { buf[len] = NUL; --- 3539,3549 ---- { char_u *val = argv0; ! # ifdef PROC_EXE_LINK char buf[PATH_MAX + 1]; ssize_t len; ! len = readlink(PROC_EXE_LINK, buf, PATH_MAX); if (len > 0) { buf[len] = NUL; *** ../vim-8.0.0463/src/auto/configure 2017-03-11 20:03:37.841266833 +0100 --- src/auto/configure 2017-03-16 14:32:39.634568907 +0100 *************** *** 10101,10115 **** ! { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /proc/self/exe" >&5 ! $as_echo_n "checking for /proc/self/exe... " >&6; } if test -L "/proc/self/exe"; then ! { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ! $as_echo "yes" >&6; } ! $as_echo "#define HAVE_PROC_SELF_EXE 1" >>confdefs.h else ! { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi --- 10101,10125 ---- ! { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /proc link to executable" >&5 ! $as_echo_n "checking for /proc link to executable... " >&6; } if test -L "/proc/self/exe"; then ! { $as_echo "$as_me:${as_lineno-$LINENO}: result: /proc/self/exe" >&5 ! $as_echo "/proc/self/exe" >&6; } ! $as_echo "#define PROC_EXE_LINK \"/proc/self/exe\"" >>confdefs.h ! ! elif test -L "/proc/self/path/a.out"; then ! { $as_echo "$as_me:${as_lineno-$LINENO}: result: /proc/self/path/a.out" >&5 ! $as_echo "/proc/self/path/a.out" >&6; } ! $as_echo "#define PROC_EXE_LINK \"/proc/self/path/a.out\"" >>confdefs.h ! ! elif test -L "/proc/curproc/file"; then ! { $as_echo "$as_me:${as_lineno-$LINENO}: result: /proc/curproc/file" >&5 ! $as_echo "/proc/curproc/file" >&6; } ! $as_echo "#define PROC_EXE_LINK \"/proc/curproc/file\"" >>confdefs.h else ! { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi *** ../vim-8.0.0463/src/version.c 2017-03-16 14:19:30.816329916 +0100 --- src/version.c 2017-03-16 14:28:24.752429616 +0100 *************** *** 766,767 **** --- 766,769 ---- { /* Add new patch number below this line */ + /**/ + 464, /**/ -- Why is it called "Windows"? "Gates" would be more appropriate... /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///