Ticket #5145: libs_libmythtv_DeviceReadBuffer.cpp-check-pthread_create.patch

File libs_libmythtv_DeviceReadBuffer.cpp-check-pthread_create.patch, 831 bytes (added by Erik Hovland <erik@…>, 16 years ago)

check pthread_create and report on failure

  • libs/libmythtv/DeviceReadBuffer.cpp

    pthread_create is not checked for error.
    
    From: Erik Hovland <erik@hovland.org>
    
    
    ---
    
     libs/libmythtv/DeviceReadBuffer.cpp |    5 ++++-
     1 files changed, 4 insertions(+), 1 deletions(-)
    
    diff --git a/libs/libmythtv/DeviceReadBuffer.cpp b/libs/libmythtv/DeviceReadBuffer.cpp
    index a64701a..2fe1c80 100644
    a b void DeviceReadBuffer::Start(void) 
    9999        return;
    100100    }
    101101
    102     pthread_create(&thread, NULL, boot_ringbuffer, this);
     102    if (pthread_create(&thread, NULL, boot_ringbuffer, this) != 0)
     103        VERBOSE(VB_IMPORTANT,
     104                LOC_ERR + QString("Start(): pthread_create failed with %1")
     105                          .arg(strerror(errno)));
    103106}
    104107
    105108void DeviceReadBuffer::Reset(const QString &streamName, int streamfd)