diff options
Diffstat (limited to 'daemon/Child.cpp')
-rw-r--r-- | daemon/Child.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/daemon/Child.cpp b/daemon/Child.cpp index c054076..9ee2ef8 100644 --- a/daemon/Child.cpp +++ b/daemon/Child.cpp | |||
@@ -86,7 +86,7 @@ static void child_handler(int signum) { | |||
86 | } | 86 | } |
87 | } | 87 | } |
88 | 88 | ||
89 | static void* durationThread(void* pVoid) { | 89 | static void *durationThread(void *) { |
90 | prctl(PR_SET_NAME, (unsigned long)&"gatord-duration", 0, 0, 0); | 90 | prctl(PR_SET_NAME, (unsigned long)&"gatord-duration", 0, 0, 0); |
91 | sem_wait(&startProfile); | 91 | sem_wait(&startProfile); |
92 | if (gSessionData->mSessionIsActive) { | 92 | if (gSessionData->mSessionIsActive) { |
@@ -102,7 +102,7 @@ static void* durationThread(void* pVoid) { | |||
102 | return 0; | 102 | return 0; |
103 | } | 103 | } |
104 | 104 | ||
105 | static void* stopThread(void* pVoid) { | 105 | static void *stopThread(void *) { |
106 | OlySocket* socket = child->socket; | 106 | OlySocket* socket = child->socket; |
107 | 107 | ||
108 | prctl(PR_SET_NAME, (unsigned long)&"gatord-stopper", 0, 0, 0); | 108 | prctl(PR_SET_NAME, (unsigned long)&"gatord-stopper", 0, 0, 0); |
@@ -139,7 +139,7 @@ static void* stopThread(void* pVoid) { | |||
139 | return 0; | 139 | return 0; |
140 | } | 140 | } |
141 | 141 | ||
142 | void* countersThread(void* pVoid) { | 142 | static void *countersThread(void *) { |
143 | prctl(PR_SET_NAME, (unsigned long)&"gatord-counters", 0, 0, 0); | 143 | prctl(PR_SET_NAME, (unsigned long)&"gatord-counters", 0, 0, 0); |
144 | 144 | ||
145 | gSessionData->hwmon.start(); | 145 | gSessionData->hwmon.start(); |
@@ -192,7 +192,7 @@ void* countersThread(void* pVoid) { | |||
192 | return NULL; | 192 | return NULL; |
193 | } | 193 | } |
194 | 194 | ||
195 | static void* senderThread(void* pVoid) { | 195 | static void *senderThread(void *) { |
196 | int length = 1; | 196 | int length = 1; |
197 | char* data; | 197 | char* data; |
198 | char end_sequence[] = {RESPONSE_APC_DATA, 0, 0, 0, 0}; | 198 | char end_sequence[] = {RESPONSE_APC_DATA, 0, 0, 0, 0}; |
@@ -340,7 +340,8 @@ void Child::run() { | |||
340 | thread_creation_success = false; | 340 | thread_creation_success = false; |
341 | } | 341 | } |
342 | 342 | ||
343 | if (gSessionData->hwmon.countersEnabled()) { | 343 | bool startcountersThread = gSessionData->hwmon.countersEnabled(); |
344 | if (startcountersThread) { | ||
344 | if (pthread_create(&countersThreadID, NULL, countersThread, this)) { | 345 | if (pthread_create(&countersThreadID, NULL, countersThread, this)) { |
345 | thread_creation_success = false; | 346 | thread_creation_success = false; |
346 | } | 347 | } |
@@ -378,7 +379,7 @@ void Child::run() { | |||
378 | } while (bytesCollected > 0); | 379 | } while (bytesCollected > 0); |
379 | logg->logMessage("Exit collect data loop"); | 380 | logg->logMessage("Exit collect data loop"); |
380 | 381 | ||
381 | if (gSessionData->hwmon.countersEnabled()) { | 382 | if (startcountersThread) { |
382 | pthread_join(countersThreadID, NULL); | 383 | pthread_join(countersThreadID, NULL); |
383 | } | 384 | } |
384 | 385 | ||