aboutsummaryrefslogtreecommitdiffstats
path: root/ncpd/packet.cc
diff options
context:
space:
mode:
authorFritz Elfert <felfert@to.com>2002-03-16 23:47:43 +0000
committerFritz Elfert <felfert@to.com>2002-03-16 23:47:43 +0000
commit69980a9469f5a2567239ea6389eca6adb77295bc (patch)
tree5874735ed534f5358e1c09ab5f5bbd21554edea5 /ncpd/packet.cc
parent193af441a127a0daabbd17c512e34817ddbcadfd (diff)
downloadplptools-69980a9469f5a2567239ea6389eca6adb77295bc.tar.gz
plptools-69980a9469f5a2567239ea6389eca6adb77295bc.tar.bz2
plptools-69980a9469f5a2567239ea6389eca6adb77295bc.zip
- ncpd: Now it's possible to change Series3/5 without restarting ncpd
Diffstat (limited to 'ncpd/packet.cc')
-rw-r--r--ncpd/packet.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/ncpd/packet.cc b/ncpd/packet.cc
index 1d3183b..b08b745 100644
--- a/ncpd/packet.cc
+++ b/ncpd/packet.cc
@@ -201,6 +201,7 @@ packet::
{
if (fd != -1) {
pthread_cancel(datapump);
+ pthread_join(datapump, NULL);
ser_exit(fd);
}
fd = -1;
@@ -212,8 +213,10 @@ packet::
void packet::
reset()
{
- if (fd != -1)
+ if (fd != -1) {
pthread_cancel(datapump);
+ pthread_join(datapump, NULL);
+ }
outRead = outWrite = 0;
internalReset();
if (fd != -1)
@@ -229,7 +232,7 @@ internalReset()
ser_exit(fd);
fd = -1;
}
- usleep(1000000);
+ usleep(100000);
inRead = inWrite = 0;
esc = false;
lastFatal = false;
@@ -499,13 +502,12 @@ linkFailed()
#endif
) {
failed = true;
- justStarted = true;
}
if ((verbose & PKT_DEBUG_LOG) && lastFatal)
cout << "packet: linkFATAL\n";
if ((verbose & PKT_DEBUG_LOG) && failed)
cout << "packet: linkFAILED\n";
- return lastFatal || failed;
+ return (lastFatal || failed);
}
/*