diff options
author | Mattias Andrée <maandree@member.fsf.org> | 2015-12-28 18:22:21 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@member.fsf.org> | 2015-12-28 18:22:21 +0100 |
commit | 280f7068d28361af3468b87eef2353d870fa3598 (patch) | |
tree | 9e4a159825c2d1d8eaf3d19750ba1925bff6a6c0 /src | |
parent | typo (diff) | |
download | sat-280f7068d28361af3468b87eef2353d870fa3598.tar.gz sat-280f7068d28361af3468b87eef2353d870fa3598.tar.bz2 sat-280f7068d28361af3468b87eef2353d870fa3598.tar.xz |
what was I thinging
Signed-off-by: Mattias Andrée <maandree@member.fsf.org>
Diffstat (limited to '')
-rw-r--r-- | src/satd-diminished.c | 20 | ||||
-rw-r--r-- | src/satd.c | 2 |
2 files changed, 1 insertions, 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; } @@ -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, |