all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Matthew Leach <matthew@mattleach.net>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: Stefan Monnier <monnier@IRO.UMontreal.CA>,
	emacs-devel <emacs-devel@gnu.org>
Subject: Re: [PATCH v5] Add systemd socket launching support
Date: Sun, 17 Apr 2016 12:30:25 +0100	[thread overview]
Message-ID: <87h9f0ealq.fsf@mattleach.net> (raw)
In-Reply-To: <5713224F.9040602@cs.ucla.edu> (Paul Eggert's message of "Sat, 16 Apr 2016 22:42:39 -0700")

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

Hi Paul,

Paul Eggert <eggert@cs.ucla.edu> 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.

Thanks,
-- 
Matt

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Check-for-positive-return-value-from-sd_is_socket.patch --]
[-- Type: text/x-diff, Size: 924 bytes --]

From bedc8edc722a169376d34b10d87799309a5bdd33 Mon Sep 17 00:00:00 2001
From: Matthew Leach <matthew@mattleach.net>
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 file.\n");
 
       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 */
 
-- 
2.8.0


  reply	other threads:[~2016-04-17 11:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-10 14:06 [PATCH v5] Add systemd socket launching support Matthew Leach
2016-04-14 17:54 ` Matthew Leach
2016-04-17  5:42   ` Paul Eggert
2016-04-17 11:30     ` Matthew Leach [this message]
2016-04-18  5:44       ` Paul Eggert
2016-04-18 19:33         ` Matthew Leach
2016-04-21 20:59         ` Matthew Leach
2016-04-26  9:17           ` Matthew Leach
2016-04-26 16:15             ` Paul Eggert
2016-04-27  9:56               ` Matthew Leach
2016-04-16  9:50 ` Eli Zaretskii
2016-04-17 11:15   ` Matthew Leach
2016-04-21 16:17     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h9f0ealq.fsf@mattleach.net \
    --to=matthew@mattleach.net \
    --cc=eggert@cs.ucla.edu \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@IRO.UMontreal.CA \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.