summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-03-16 15:13:45 +0100
committerBram Moolenaar <Bram@vim.org>2017-03-16 15:13:45 +0100
commitf3757f0c87bbd52c7989c85dcbd21511bffcbdd6 (patch)
tree498b5670475fcb798fb3a2a3231333192005f4f6
parent0f39a82b07b285e0c54162e1038348b2988a715c (diff)
downloadvim-git-f3757f0c87bbd52c7989c85dcbd21511bffcbdd6.tar.gz
patch 8.0.0464: can't find executable name on Solaris and FreeBSDv8.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".
-rwxr-xr-xsrc/auto/configure22
-rw-r--r--src/config.h.in4
-rw-r--r--src/configure.ac17
-rw-r--r--src/main.c4
-rw-r--r--src/version.c2
5 files changed, 35 insertions, 14 deletions
diff --git a/src/auto/configure b/src/auto/configure
index 73b9ce7d5..44532cf5e 100755
--- a/src/auto/configure
+++ b/src/auto/configure
@@ -10101,15 +10101,25 @@ fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for /proc/self/exe" >&5
-$as_echo_n "checking for /proc/self/exe... " >&6; }
+{ $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: yes" >&5
-$as_echo "yes" >&6; }
- $as_echo "#define HAVE_PROC_SELF_EXE 1" >>confdefs.h
+ { $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 "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
diff --git a/src/config.h.in b/src/config.h.in
index a9bcf1ef3..f8a23ed78 100644
--- a/src/config.h.in
+++ b/src/config.h.in
@@ -446,8 +446,8 @@
/* 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 /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
diff --git a/src/configure.ac b/src/configure.ac
index 4445cf5bf..6251681e4 100644
--- a/src/configure.ac
+++ b/src/configure.ac
@@ -3020,12 +3020,21 @@ dnl ---------------------------------------------------------------------------
dnl end of GUI-checking
dnl ---------------------------------------------------------------------------
-AC_MSG_CHECKING([for /proc/self/exe])
+AC_MSG_CHECKING([for /proc link to executable])
if test -L "/proc/self/exe"; then
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_PROC_SELF_EXE)
+ 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)
+ AC_MSG_RESULT(no)
fi
dnl Check for Cygwin, which needs an extra source file if not using X11
diff --git a/src/main.c b/src/main.c
index aa5a1a20c..29ab3c6e9 100644
--- a/src/main.c
+++ b/src/main.c
@@ -3539,11 +3539,11 @@ set_progpath(char_u *argv0)
{
char_u *val = argv0;
-# ifdef HAVE_PROC_SELF_EXE
+# ifdef PROC_EXE_LINK
char buf[PATH_MAX + 1];
ssize_t len;
- len = readlink("/proc/self/exe", buf, PATH_MAX);
+ len = readlink(PROC_EXE_LINK, buf, PATH_MAX);
if (len > 0)
{
buf[len] = NUL;
diff --git a/src/version.c b/src/version.c
index c1ac29d92..efef5f8d9 100644
--- a/src/version.c
+++ b/src/version.c
@@ -765,6 +765,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 464,
+/**/
463,
/**/
462,