diff --git a/iodine.c b/iodine.c index d536c84..6a8c5a2 100644 --- a/iodine.c +++ b/iodine.c @@ -232,7 +232,7 @@ main(int argc, char **argv) } if ((tun_fd = open_tun()) == -1) - goto cleanup1; + goto cleanup0; if ((dns_fd = open_dns(argv[0], argv[1])) == -1) goto cleanup2; @@ -249,6 +249,7 @@ main(int argc, char **argv) } if (!foreground) { + printf("Detaching from terminal...\n"); daemon(0, 0); umask(0); alarm(0); @@ -269,6 +270,7 @@ cleanup2: close_dns(dns_fd); cleanup1: close_tun(tun_fd); +cleanup0: return 0; } diff --git a/iodined.c b/iodined.c index 9951fef..03f3654 100644 --- a/iodined.c +++ b/iodined.c @@ -221,6 +221,7 @@ main(int argc, char **argv) } if (!foreground) { + printf("Detaching from terminal...\n"); daemon(0, 0); umask(0); alarm(0);