fix for confused fork

This commit is contained in:
Andrew Pamment 2016-08-13 11:07:02 +10:00
parent 498b475df6
commit bfabd9ead4

4
main.c
View File

@ -655,11 +655,11 @@ void server(int port) {
// fork ssh server // fork ssh server
ssh_pid = fork(); ssh_pid = fork();
if (ssh_pid > 0) { if (ssh_pid == 0) {
serverssh(conf.ssh_port); serverssh(conf.ssh_port);
exit(0); exit(0);
} }
if (ssh_pid != 0) { if (ssh_pid < 0) {
fprintf(stderr, "Error forking ssh server."); fprintf(stderr, "Error forking ssh server.");
} }
} }