From bedc8edc722a169376d34b10d87799309a5bdd33 Mon Sep 17 00:00:00 2001 From: Matthew Leach 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