Diffstat (limited to 'noncore/multimedia/opieplayer2/threadutil.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/threadutil.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/noncore/multimedia/opieplayer2/threadutil.cpp b/noncore/multimedia/opieplayer2/threadutil.cpp index b5cac61..5fc8a0b 100644 --- a/noncore/multimedia/opieplayer2/threadutil.cpp +++ b/noncore/multimedia/opieplayer2/threadutil.cpp @@ -230,18 +230,23 @@ bool Thread::isRunning() const void Thread::exit() { pthread_exit( 0 ); } -OnewayNotifier::OnewayNotifier() +OnewayNotifier::OnewayNotifier() : + m_readFd(-1), + m_writeFd(-1) { - int fds[ 2 ]; - pipe( fds ); + int fds[ 2 ] = { -1, -1 }; + if (pipe( fds ) == 0) { m_readFd = fds[ 0 ]; m_writeFd = fds[ 1 ]; + } else { + owarn << "Call to pipe() failed" << oendl; + } m_notifier = new QSocketNotifier( m_readFd, QSocketNotifier::Read ); connect( m_notifier, SIGNAL( activated(int) ), this, SLOT( wakeUp() ) ); } |