summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHåkon Nessjøen <haakon.nessjoen@gmail.com>2011-11-08 23:40:06 +0100
committerHåkon Nessjøen <haakon.nessjoen@gmail.com>2011-11-08 23:40:06 +0100
commit904d05c3d9dec35bad0413f933ea690868a09f4f (patch)
tree46cd97b0d0a362a4740f3649863040f67486b749
parentd876aad77b29f410c9c4218636482cab59504fac (diff)
downloadMAC-Telnet-904d05c3d9dec35bad0413f933ea690868a09f4f.tar.gz
MAC-Telnet-904d05c3d9dec35bad0413f933ea690868a09f4f.zip
Cleanup
-rw-r--r--mactelnetd.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/mactelnetd.c b/mactelnetd.c
index c78304b..ed9c3f9 100644
--- a/mactelnetd.c
+++ b/mactelnetd.c
@@ -547,7 +547,7 @@ static void handle_data_packet(struct mt_connection *curconn, struct mt_mactelne
for (i = 0; i < 16; ++i) {
curconn->enckey[i] = rand() % 256;
}
- curconn->have_enckey=1;
+ curconn->have_enckey = 1;
memset(curconn->trypassword, 0, sizeof(curconn->trypassword));
}
@@ -754,11 +754,6 @@ static void daemonize() {
fd = open("/dev/null",O_RDWR);
dup(fd);
dup(fd);
-
- signal(SIGCHLD,SIG_IGN);
- signal(SIGTSTP,SIG_IGN);
- signal(SIGTTOU,SIG_IGN);
- signal(SIGTTIN,SIG_IGN);
}
static void print_version() {
@@ -927,13 +922,14 @@ int main (int argc, char **argv) {
if (!foreground) {
daemonize();
- } else {
- signal(SIGCHLD,SIG_IGN);
- signal(SIGTSTP,SIG_IGN);
- signal(SIGTTOU,SIG_IGN);
- signal(SIGTTIN,SIG_IGN);
}
+ /* Handle zombies etc */
+ signal(SIGCHLD,SIG_IGN);
+ signal(SIGTSTP,SIG_IGN);
+ signal(SIGTTOU,SIG_IGN);
+ signal(SIGTTIN,SIG_IGN);
+
openlog("mactelnetd", LOG_PID, LOG_DAEMON);
syslog(LOG_NOTICE, "Bound to %s:%d", inet_ntoa(si_me.sin_addr), sourceport);