aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@member.fsf.org>2015-12-28 00:39:41 +0100
committerMattias Andrée <maandree@member.fsf.org>2015-12-28 00:39:41 +0100
commit22693dbc4841caf5177dea8658d86d4e93052286 (patch)
treeedfdc5b6fe172ecce53cc30964fe3631a9fe5f1f
parentdoc (diff)
downloadsat-22693dbc4841caf5177dea8658d86d4e93052286.tar.gz
sat-22693dbc4841caf5177dea8658d86d4e93052286.tar.bz2
sat-22693dbc4841caf5177dea8658d86d4e93052286.tar.xz
the socket shall be opened on fd 3 (you will see why later)
Signed-off-by: Mattias Andrée <maandree@member.fsf.org>
-rw-r--r--src/satd.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/satd.c b/src/satd.c
index 7eb1b55..c2c1525 100644
--- a/src/satd.c
+++ b/src/satd.c
@@ -140,6 +140,10 @@ main(int argc, char *argv[])
t (foreground ? 0 : daemonise("satd", 0));
t (sock = create_socket(&address), sock == -1);
+ if (sock != 3) {
+ t (dup2(sock, 3) == -1);
+ close(sock), sock = 3;
+ }
close(sock);
unlink(address.sun_path);