diff options
Diffstat (limited to 'src/kernel/qeventloop_unix_glib.cpp')
-rw-r--r-- | src/kernel/qeventloop_unix_glib.cpp | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/src/kernel/qeventloop_unix_glib.cpp b/src/kernel/qeventloop_unix_glib.cpp index 6852f6b..6a890ce 100644 --- a/src/kernel/qeventloop_unix_glib.cpp +++ b/src/kernel/qeventloop_unix_glib.cpp @@ -44,6 +44,7 @@ #include "qeventloop.h" #include "qapplication.h" #include "qbitarray.h" +#include "qmutex.h" #include <stdlib.h> #include <sys/types.h> @@ -369,9 +370,9 @@ void QEventLoop::registerSocketNotifier( QSocketNotifier *notifier ) return; } - #ifdef DEBUG_QT_GLIBMAINLOOP - printf("register socket notifier %d\n", sockfd); - #endif +#ifdef DEBUG_QT_GLIBMAINLOOP + printf("register socket notifier %d\n", sockfd); +#endif QPtrList<QSockNotGPollFD> *list = &d->sn_list; QSockNotGPollFD *sn; @@ -424,9 +425,9 @@ void QEventLoop::unregisterSocketNotifier( QSocketNotifier *notifier ) return; } - #ifdef DEBUG_QT_GLIBMAINLOOP - printf("unregister socket notifier %d\n", sockfd); - #endif +#ifdef DEBUG_QT_GLIBMAINLOOP + printf("unregister socket notifier %d\n", sockfd); +#endif QPtrList<QSockNotGPollFD> *list = &d->sn_list; QSockNotGPollFD *sn; @@ -457,9 +458,9 @@ void QEventLoop::setSocketNotifierPending( QSocketNotifier *notifier ) return; } - #ifdef DEBUG_QT_GLIBMAINLOOP - printf("set socket notifier pending %d\n", sockfd); - #endif +#ifdef DEBUG_QT_GLIBMAINLOOP + printf("set socket notifier pending %d\n", sockfd); +#endif QPtrList<QSockNotGPollFD> *list = &d->sn_list; QSockNotGPollFD *sn; @@ -505,7 +506,9 @@ void QEventLoop::wakeUp() size_t nbytes = 0; char c = 0; if ( ::ioctl( d->thread_pipe[0], FIONREAD, (char*)&nbytes ) >= 0 && nbytes == 0 ) { - ::write( d->thread_pipe[1], &c, 1 ); + if (::write( d->thread_pipe[1], &c, 1 ) < 0) { + // Failed! + } } } @@ -576,17 +579,14 @@ int QEventLoop::activateSocketNotifiers() while ( (sn=it.current()) ) { ++it; d->sn_pending_list.removeRef( sn ); - if ( sn->pending ) { - - #ifdef DEBUG_QT_GLIBMAINLOOP - printf("activate sn : send event fd=%d\n", sn->gPollFD.fd ); - #endif - - - sn->pending = FALSE; - QApplication::sendEvent( sn->obj, &event ); - n_act++; - } + if ( sn->pending ) { +#ifdef DEBUG_QT_GLIBMAINLOOP + printf("activate sn : send event fd=%d\n", sn->gPollFD.fd ); +#endif + sn->pending = FALSE; + QApplication::sendEvent( sn->obj, &event ); + n_act++; + } } return n_act; |