GNU bug report logs - #47800
[native-comp] could not resolve realpath of "emacs"

Previous Next

Package: emacs;

Reported by: Dario Gjorgjevski <dario.gjorgjevski <at> gmail.com>

Date: Thu, 15 Apr 2021 14:10:01 UTC

Severity: normal

Merged with 47825

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #17 received at 47800 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dario Gjorgjevski <dario.gjorgjevski <at> gmail.com>
Cc: psainty <at> orcon.net.nz, 47800 <at> debbugs.gnu.org
Subject: Re: bug#47800: [native-comp] could not resolve realpath of "emacs"
Date: Thu, 15 Apr 2021 18:08:01 +0300
> From: Dario Gjorgjevski <dario.gjorgjevski <at> gmail.com>
> Date: Thu, 15 Apr 2021 16:26:43 +0200
> Cc: 47800 <at> debbugs.gnu.org
> 
> > Hi Dario.  See also:
> >
> > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=44128
> 
> Thanks Phil.  What Eli wrote in message#28 there describes the issue
> very well.

Does the untested patch below fix the problem?

diff --git a/src/emacs.c b/src/emacs.c
index a256564..7eaaa28 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -846,7 +846,11 @@ load_pdump_find_executable (char const *argv0, ptrdiff_t *candidate_size)
       struct stat st;
       if (file_access_p (candidate, X_OK)
 	  && stat (candidate, &st) == 0 && S_ISREG (st.st_mode))
-	return candidate;
+	{
+	  if (lstat (candidate, &st) == 0 && S_ISLNK (st.st_mode))
+	    return realpath (candidate, NULL);
+	  return candidate;
+	}
       *candidate = '\0';
     }
   while (*path++ != '\0');




This bug report was last modified 4 years and 34 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.