unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: master 9fc3b00373: Improve `restart-emacs' error reporting
       [not found] ` <20220418090310.749C3C01684@vcs2.savannah.gnu.org>
@ 2022-04-18  9:08   ` Po Lu
  2022-04-18  9:13     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Po Lu @ 2022-04-18  9:08 UTC (permalink / raw)
  To: emacs-devel; +Cc: Lars Ingebrigtsen

Lars Ingebrigtsen <larsi@gnus.org> writes:

> +      /* Check that the binary hasn't gone away.  */
> +      if (!file_access_p (initial_argv[0], F_OK))
> +	error ("Emacs executable \"%s\" can't be found", initial_argv[0]);
> +    }

How would this work if initial_argv[0] is a binary in the PATH, not a
file name?



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: master 9fc3b00373: Improve `restart-emacs' error reporting
  2022-04-18  9:08   ` master 9fc3b00373: Improve `restart-emacs' error reporting Po Lu
@ 2022-04-18  9:13     ` Lars Ingebrigtsen
  2022-04-18  9:21       ` Philipp Stephani
  0 siblings, 1 reply; 3+ messages in thread
From: Lars Ingebrigtsen @ 2022-04-18  9:13 UTC (permalink / raw)
  To: Po Lu; +Cc: emacs-devel

Po Lu <luangruo@yahoo.com> writes:

> How would this work if initial_argv[0] is a binary in the PATH, not a
> file name?

Oh, it won't.  But I was thinking we'd need to store the actual binary
we're using (because of --chdir/default-directory problems) somewhere,
so I'll be adjusting the test and code from argv[0] to the actual
binary in a while.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: master 9fc3b00373: Improve `restart-emacs' error reporting
  2022-04-18  9:13     ` Lars Ingebrigtsen
@ 2022-04-18  9:21       ` Philipp Stephani
  0 siblings, 0 replies; 3+ messages in thread
From: Philipp Stephani @ 2022-04-18  9:21 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Po Lu, Emacs developers

Am Mo., 18. Apr. 2022 um 11:14 Uhr schrieb Lars Ingebrigtsen <larsi@gnus.org>:
>
> Po Lu <luangruo@yahoo.com> writes:
>
> > How would this work if initial_argv[0] is a binary in the PATH, not a
> > file name?
>
> Oh, it won't.  But I was thinking we'd need to store the actual binary
> we're using (because of --chdir/default-directory problems) somewhere,
> so I'll be adjusting the test and code from argv[0] to the actual
> binary in a while.

On GNU/Linux, use getauxval(AT_EXECFN) or (probably even better)
getauxval(AT_EXECFD) with fexecve.



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-04-18  9:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <165027259019.5917.10350012783877143480@vcs2.savannah.gnu.org>
     [not found] ` <20220418090310.749C3C01684@vcs2.savannah.gnu.org>
2022-04-18  9:08   ` master 9fc3b00373: Improve `restart-emacs' error reporting Po Lu
2022-04-18  9:13     ` Lars Ingebrigtsen
2022-04-18  9:21       ` Philipp Stephani

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).