From 280f7068d28361af3468b87eef2353d870fa3598 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 28 Dec 2015 18:22:21 +0100 Subject: what was I thinging MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/satd-diminished.c | 20 +------------------- src/satd.c | 2 -- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/src/satd-diminished.c b/src/satd-diminished.c index e151c5b..d05823d 100644 --- a/src/satd-diminished.c +++ b/src/satd-diminished.c @@ -38,11 +38,6 @@ */ #define STATE_FILENO 4 -/** - * The file descriptor for connection to the current client. - */ -#define CONN_FILENO 5 - /** * Command: queue a job. @@ -125,14 +120,6 @@ main(int argc, char *argv[], char *envp[]) if (signal(SIGHUP, sighandler) == SIG_ERR) goto fail; if (signal(SIGCHLD, sighandler) == SIG_ERR) goto fail; - /* Pick-up where we left off. */ - if (!fstat(CONN_FILENO, &_attr)) { - fd = CONN_FILENO; - goto peek_again; - } else if (errno != EBADF) { - goto fail; - } - /* The magnificent loop. */ accept_again: if (received_signo == SIGHUP) { @@ -152,13 +139,8 @@ accept_again: goto fail; } } - if (fd != CONN_FILENO) { - if (dup2(fd, CONN_FILENO) == -1) - goto fail; - close(fd), fd = CONN_FILENO; - } peek_again: - if (recv(fd, &type, sizeof(char), MSG_PEEK /* Just peek in case we fail! */) <= 0) { + if (read(fd, &type, sizeof(char)) <= 0) { perror(argv[0]); goto connection_done; } diff --git a/src/satd.c b/src/satd.c index 40e04ac..f69af3b 100644 --- a/src/satd.c +++ b/src/satd.c @@ -263,8 +263,6 @@ main(int argc, char *argv[]) /* Daemonise. */ t (foreground ? 0 : daemonise("satd", DAEMONISE_KEEP_FDS, sock, -1)); - if (foreground) - close(5); /* Required to be closed by the next image. */ /* Change to a process image without all this initialisation text. */ execl(LIBEXEC "/" PACKAGE "/satd-diminished", argv0, -- cgit v1.2.3-70-g09d2