#ifdef MSDOS
#include <binary-io.h>
+#include "dosfns.h"
#endif
#ifdef HAVE_LIBSYSTEMD
w32_daemon_event = NULL;
#endif
+
+ int sockfd = -1;
+
if (argmatch (argv, argc, "-daemon", "--daemon", 5, NULL, &skip_args)
|| argmatch (argv, argc, "-daemon", "--daemon", 5, &dname_arg, &skip_args))
{
else if (systemd_socket == 1
&& (0 < sd_is_socket (SD_LISTEN_FDS_START,
AF_UNSPEC, SOCK_STREAM, 1)))
- set_external_socket_descriptor (SD_LISTEN_FDS_START);
+ sockfd = SD_LISTEN_FDS_START;
#endif /* HAVE_LIBSYSTEMD */
#ifndef DAEMON_MUST_EXEC
/* This can create a thread that may call getenv, so it must follow
all calls to putenv and setenv. Also, this sets up
add_keyboard_wait_descriptor, which init_display uses. */
- init_process_emacs ();
+ init_process_emacs (sockfd);
init_keyboard (); /* This too must precede init_sys_modes. */
if (!noninteractive)