unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#35406: Build error for emacsclient on FreeBSD
@ 2019-04-23 23:26 Josh Howard
  2019-04-24 16:10 ` Glenn Morris
  0 siblings, 1 reply; 5+ messages in thread
From: Josh Howard @ 2019-04-23 23:26 UTC (permalink / raw)
  To: 35406

It appears in a recent commit there was a change to emacsclient.c that breaks its ability to build on FreeBSD by using the euidaccess() function which doesn't exist on the platform.

CCLD     emacsclient
emacsclient.c:1475:11: warning: implicit declaration of function 'euidaccess' is
      invalid in C99 [-Wimplicit-function-declaration]
              && euidaccess (sockdirname, X_OK) == 0)
                 ^
1 warning generated.
/usr/bin/ld: error: undefined symbol: euidaccess
>>> referenced by emacsclient.c:1475
>>>               /tmp/emacsclient-a0b189.o:(set_local_socket)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
gmake: *** [Makefile:399: emacsclient] Error 1

I'd propose it be switched to eaccess() which should be a synonym on Linux and makes it a bit more portable.

diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index 5871a18ce6..aac1b3c2b4 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -1472,7 +1472,7 @@ set_local_socket (char const *server_name)
          int sockdirnamelen = snprintf (sockdirname, sizeof sockdirname,
                                         "/run/user/%"PRIuMAX, id);
          if (0 <= sockdirnamelen && sockdirnamelen < sizeof sockdirname
-             && euidaccess (sockdirname, X_OK) == 0)
+             && eaccess (sockdirname, X_OK) == 0)
            message
              (true,
               ("%s: Should XDG_RUNTIME_DIR='%s' be in the environment?\n"






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

* bug#35406: Build error for emacsclient on FreeBSD
  2019-04-23 23:26 bug#35406: Build error for emacsclient on FreeBSD Josh Howard
@ 2019-04-24 16:10 ` Glenn Morris
  2019-04-25  0:45   ` Paul Eggert
  0 siblings, 1 reply; 5+ messages in thread
From: Glenn Morris @ 2019-04-24 16:10 UTC (permalink / raw)
  To: 35406, Paul Eggert; +Cc: Josh Howard


cc'ing the author of
http://lists.gnu.org/r/emacs-diffs/2019-04/msg00463.html

Josh Howard wrote:

> It appears in a recent commit there was a change to emacsclient.c that breaks its ability to build on FreeBSD by using the euidaccess() function which doesn't exist on the platform.
>
> CCLD     emacsclient
> emacsclient.c:1475:11: warning: implicit declaration of function 'euidaccess' is
>       invalid in C99 [-Wimplicit-function-declaration]
>               && euidaccess (sockdirname, X_OK) == 0)
>                  ^
> 1 warning generated.
> /usr/bin/ld: error: undefined symbol: euidaccess
>>>> referenced by emacsclient.c:1475
>>>>               /tmp/emacsclient-a0b189.o:(set_local_socket)
> cc: error: linker command failed with exit code 1 (use -v to see invocation)
> gmake: *** [Makefile:399: emacsclient] Error 1
>
> I'd propose it be switched to eaccess() which should be a synonym on Linux and makes it a bit more portable.
>
> diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
> index 5871a18ce6..aac1b3c2b4 100644
> --- a/lib-src/emacsclient.c
> +++ b/lib-src/emacsclient.c
> @@ -1472,7 +1472,7 @@ set_local_socket (char const *server_name)
>           int sockdirnamelen = snprintf (sockdirname, sizeof sockdirname,
>                                          "/run/user/%"PRIuMAX, id);
>           if (0 <= sockdirnamelen && sockdirnamelen < sizeof sockdirname
> -             && euidaccess (sockdirname, X_OK) == 0)
> +             && eaccess (sockdirname, X_OK) == 0)
>             message
>               (true,
>                ("%s: Should XDG_RUNTIME_DIR='%s' be in the environment?\n"





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

* bug#35406: Build error for emacsclient on FreeBSD
  2019-04-24 16:10 ` Glenn Morris
@ 2019-04-25  0:45   ` Paul Eggert
  2019-04-25  3:21     ` Josh Howard
  0 siblings, 1 reply; 5+ messages in thread
From: Paul Eggert @ 2019-04-25  0:45 UTC (permalink / raw)
  To: Glenn Morris, 35406; +Cc: Josh Howard

[-- Attachment #1: Type: text/plain, Size: 334 bytes --]

Josh Howard wrote:
> I'd propose it be switched to eaccess() which should be a synonym on Linux and makes it a bit more portable.
Sorry, I messed up. I should have used the POSIX-specified faccessat,
which has a Gnulib portability emulation for platforms lacking
faccessat. I installed the attached into master; please give it a try.

[-- Attachment #2: euidaccess.patch --]
[-- Type: text/x-patch, Size: 600 bytes --]

diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index 5871a18ce6..fd56007b15 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -1472,7 +1472,7 @@ set_local_socket (char const *server_name)
 	  int sockdirnamelen = snprintf (sockdirname, sizeof sockdirname,
 					 "/run/user/%"PRIuMAX, id);
 	  if (0 <= sockdirnamelen && sockdirnamelen < sizeof sockdirname
-	      && euidaccess (sockdirname, X_OK) == 0)
+	      && faccessat (AT_FDCWD, sockdirname, X_OK, AT_EACCESS) == 0)
 	    message
 	      (true,
 	       ("%s: Should XDG_RUNTIME_DIR='%s' be in the environment?\n"

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

* bug#35406: Build error for emacsclient on FreeBSD
  2019-04-25  0:45   ` Paul Eggert
@ 2019-04-25  3:21     ` Josh Howard
  2019-04-25 22:15       ` Paul Eggert
  0 siblings, 1 reply; 5+ messages in thread
From: Josh Howard @ 2019-04-25  3:21 UTC (permalink / raw)
  To: Paul Eggert, Glenn Morris, 35406@debbugs.gnu.org

> From: Paul Eggert <eggert@cs.ucla.edu>
> Sent: Wednesday, April 24, 2019 5:45 PM
> To: Glenn Morris; 35406@debbugs.gnu.org
> Cc: Josh Howard
> Subject: Re: bug#35406: Build error for emacsclient on FreeBSD
> 
> Sorry, I messed up. I should have used the POSIX-specified faccessat,
> which has a Gnulib portability emulation for platforms lacking
> faccessat. I installed the attached into master; please give it a try.

Yep, this works fine. Thanks!






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

* bug#35406: Build error for emacsclient on FreeBSD
  2019-04-25  3:21     ` Josh Howard
@ 2019-04-25 22:15       ` Paul Eggert
  0 siblings, 0 replies; 5+ messages in thread
From: Paul Eggert @ 2019-04-25 22:15 UTC (permalink / raw)
  To: Josh Howard, Glenn Morris, 35406-done

On 4/24/19 8:21 PM, Josh Howard wrote:
>
> Yep, this works fine. Thanks!
>
Thanks for checking; closing the bug report.






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

end of thread, other threads:[~2019-04-25 22:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-23 23:26 bug#35406: Build error for emacsclient on FreeBSD Josh Howard
2019-04-24 16:10 ` Glenn Morris
2019-04-25  0:45   ` Paul Eggert
2019-04-25  3:21     ` Josh Howard
2019-04-25 22:15       ` Paul Eggert

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).