From bfabd9ead40e95c38c3d0db90a11b4f10f3c1279 Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Sat, 13 Aug 2016 11:07:02 +1000 Subject: [PATCH] fix for confused fork --- main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index 46793b0..7c859e9 100644 --- a/main.c +++ b/main.c @@ -655,11 +655,11 @@ void server(int port) { // fork ssh server ssh_pid = fork(); - if (ssh_pid > 0) { + if (ssh_pid == 0) { serverssh(conf.ssh_port); exit(0); } - if (ssh_pid != 0) { + if (ssh_pid < 0) { fprintf(stderr, "Error forking ssh server."); } }