aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattias Andrée <maandree@member.fsf.org>2015-12-28 18:22:21 +0100
committerMattias Andrée <maandree@member.fsf.org>2015-12-28 18:22:21 +0100
commit280f7068d28361af3468b87eef2353d870fa3598 (patch)
tree9e4a159825c2d1d8eaf3d19750ba1925bff6a6c0 /src
parenttypo (diff)
downloadsat-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 'src')
-rw-r--r--src/satd-diminished.c20
-rw-r--r--src/satd.c2
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;
}
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,