[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v5] Add systemd socket launching support

From: Matthew Leach
Subject: Re: [PATCH v5] Add systemd socket launching support
Date: Sun, 17 Apr 2016 12:30:25 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Hi Paul,

Paul Eggert <address@hidden> writes:

> Is there any reason for the specific value 226 in configure.ac's
> '[libsystemd >= 226]'? Won't this code work with libsystemd 222, say?
> That's the version in Fedora 23.

There is no specific reason other than 226 is what is installed on my
system and what I have tested against.  If you are able to test on an
earlier version, this number could be reduced.

> The code tests whether st_is_socket returns a nonnegative value, but
> shouldn't it be testing whether it returns a positive value?

Indeed, you're correct, I missed that one.  The attached patch should
take care of that.

>From bedc8edc722a169376d34b10d87799309a5bdd33 Mon Sep 17 00:00:00 2001
From: Matthew Leach <address@hidden>
Date: Sun, 17 Apr 2016 12:25:55 +0100
Subject: [PATCH] Check for positive return value from 'sd_is_socket'

* src/emacs.c (main): Ensure that 'sd_is_socket' returns a positive
  value, which indicates this is a valid socket.
 src/emacs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/emacs.c b/src/emacs.c
index a51df09..5563624 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -1017,7 +1017,7 @@ Try adding 'Accept=false' in the Emacs socket unit 
       else if (systemd_socket == 1 &&
                sd_is_socket (SD_LISTEN_FDS_START,
-                             AF_UNSPEC, SOCK_STREAM, 1) >= 0)
+                             AF_UNSPEC, SOCK_STREAM, 1) > 0)
         set_external_socket_descriptor (SD_LISTEN_FDS_START);
 #endif /* HAVE_LIBSYSTEMD */

reply via email to

[Prev in Thread] Current Thread [Next in Thread]