aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);