diff options
author | Reuben Thomas <rrt@sc3d.org> | 2008-02-05 00:58:09 +0000 |
---|---|---|
committer | Reuben Thomas <rrt@sc3d.org> | 2008-02-05 00:58:09 +0000 |
commit | dd74bdb48560800cfffa7c48cacc2c42a912588b (patch) | |
tree | cc736970345558ee0181035c2d1e5127d46c3f96 /ncpd/main.cc | |
parent | ab62a3096711e3e9c87b6c0405fcecf81f753d53 (diff) | |
download | plptools-dd74bdb48560800cfffa7c48cacc2c42a912588b.tar.gz plptools-dd74bdb48560800cfffa7c48cacc2c42a912588b.tar.bz2 plptools-dd74bdb48560800cfffa7c48cacc2c42a912588b.zip |
Fix a crash during shut down (typo in thread initialisation).
Diffstat (limited to 'ncpd/main.cc')
-rw-r--r-- | ncpd/main.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ncpd/main.cc b/ncpd/main.cc index 3c70a50..851ea9f 100644 --- a/ncpd/main.cc +++ b/ncpd/main.cc @@ -135,7 +135,7 @@ pollSocketConnections(void *) numScp--; for (int j = i; j < numScp; j++) scp[j] = scp[j + 1]; - i--; + i--; } } } @@ -383,7 +383,7 @@ main(int argc, char **argv) lerr << "Could not create Link thread" << endl; exit(-1); } - if (pthread_create(&thr_a, NULL, + if (pthread_create(&thr_b, NULL, pollSocketConnections, NULL) != 0) { lerr << "Could not create Socket thread" << endl; exit(-1); @@ -393,10 +393,14 @@ main(int argc, char **argv) linf << _("terminating") << endl; void *ret; pthread_join(thr_a, &ret); + linf << _("joined Link thread") << endl; pthread_join(thr_b, &ret); + linf << _("joined Socket thread") << endl; delete theNCP; + linf << _("shut down NCP") << endl; } skt.closeSocket(); + linf << _("socket closed") << endl; break; case -1: lerr << "fork: " << strerror(errno) << endl; @@ -404,6 +408,8 @@ main(int argc, char **argv) default: exit(0); } + linf << _("normal exit") << endl; + return 0; } /* |