pthread_create returns a value. It should be checked.
From: Erik Hovland <erik@hovland.org>
---
libs/libmythtv/linuxfirewiredevice.cpp | 18 ++++++++++++++++--
1 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/libs/libmythtv/linuxfirewiredevice.cpp b/libs/libmythtv/linuxfirewiredevice.cpp
index ea826aa..344dc73 100644
a
|
b
|
bool LinuxFirewireDevice::OpenPort(void) |
277 | 277 | } |
278 | 278 | |
279 | 279 | VERBOSE(VB_RECORD, LOC + "Starting port handler thread"); |
| 280 | int rval = pthread_create(&m_priv->port_handler_thread, NULL, |
| 281 | linux_firewire_device_port_handler_thunk, this); |
| 282 | if (rval != 0) |
| 283 | { |
| 284 | VERBOSE(VB_IMPORTANT, |
| 285 | LOC_ERR |
| 286 | + QString("Failed to create port handler thread with error %1") |
| 287 | .arg(strerror(rval))); |
| 288 | |
| 289 | m_lock.unlock(); |
| 290 | ClosePort(); |
| 291 | m_lock.lock(); |
| 292 | |
| 293 | return false; |
| 294 | } |
| 295 | |
280 | 296 | m_priv->run_port_handler = true; |
281 | | pthread_create(&m_priv->port_handler_thread, NULL, |
282 | | linux_firewire_device_port_handler_thunk, this); |
283 | 297 | |
284 | 298 | VERBOSE(VB_RECORD, LOC + "Waiting for port handler thread to start"); |
285 | 299 | while (!m_priv->is_port_handler_running) |