-rw-r--r-- | noncore/net/opietooth/lib/device.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/noncore/net/opietooth/lib/device.cc b/noncore/net/opietooth/lib/device.cc index 0c552ea..468f191 100644 --- a/noncore/net/opietooth/lib/device.cc +++ b/noncore/net/opietooth/lib/device.cc | |||
@@ -1,7 +1,9 @@ | |||
1 | 1 | ||
2 | #include <signal.h> | ||
3 | |||
2 | #include "kprocess.h" | 4 | #include "kprocess.h" |
3 | 5 | ||
4 | #include "device.h" | 6 | #include "device.h" |
5 | 7 | ||
6 | using namespace OpieTooth; | 8 | using namespace OpieTooth; |
7 | 9 | ||
@@ -38,13 +40,13 @@ void Device::attach(){ | |||
38 | void Device::detach(){ | 40 | void Device::detach(){ |
39 | delete m_hci; | 41 | delete m_hci; |
40 | delete m_process; | 42 | delete m_process; |
41 | // kill the pid we got | 43 | // kill the pid we got |
42 | if(m_attached ) | 44 | if(m_attached ) |
43 | //kill the pid | 45 | //kill the pid |
44 | ; | 46 | kill(pid, 9); |
45 | } | 47 | } |
46 | bool Device::isLoaded()const{ | 48 | bool Device::isLoaded()const{ |
47 | return m_attached; | 49 | return m_attached; |
48 | } | 50 | } |
49 | QString Device::devName()const { | 51 | QString Device::devName()const { |
50 | return QString::fromLatin1("hci0"); | 52 | return QString::fromLatin1("hci0"); |
@@ -87,13 +89,13 @@ void Device::slotExited( KProcess* proc) | |||
87 | } | 89 | } |
88 | void Device::slotStdOut(KProcess* proc, char* chars, int len) | 90 | void Device::slotStdOut(KProcess* proc, char* chars, int len) |
89 | { | 91 | { |
90 | if( len <1 ) | 92 | if( len <1 ) |
91 | return; | 93 | return; |
92 | if(proc == m_process ){ | 94 | if(proc == m_process ){ |
93 | QCString string( chars ); | 95 | QCString string( chars, len+1 ); |
94 | if(string.left(3) != "CSR" ){ // it's the pid | 96 | if(string.left(3) != "CSR" ){ // it's the pid |
95 | pid = string.toInt(); | 97 | pid = string.toInt(); |
96 | }; | 98 | }; |
97 | } | 99 | } |
98 | } | 100 | } |
99 | void Device::slotStdErr(KProcess*, char*, int ) | 101 | void Device::slotStdErr(KProcess*, char*, int ) |