diff options
author | Darrell Anderson <humanreadable@yahoo.com> | 2012-12-19 14:03:14 -0600 |
---|---|---|
committer | Darrell Anderson <humanreadable@yahoo.com> | 2012-12-19 14:03:14 -0600 |
commit | f8224f3a623495e4e1dbf852554d7601a6b7c4c4 (patch) | |
tree | d5583114ba48669960c9f7d68927687ea652a0b8 /src/kernel/qeventloop_unix_glib.cpp | |
parent | 25240579092616b09d28705ac84e13e49b744707 (diff) | |
parent | e8cbbedf46da493d2c206444a7e18e5777402905 (diff) | |
download | tqt-f8224f3a623495e4e1dbf852554d7601a6b7c4c4.tar.gz tqt-f8224f3a623495e4e1dbf852554d7601a6b7c4c4.zip |
Merge branch 'master' of http://scm.trinitydesktop.org/scm/git/tqt3
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 dc973277e..7f1035fdf 100644 --- a/src/kernel/qeventloop_unix_glib.cpp +++ b/src/kernel/qeventloop_unix_glib.cpp @@ -44,6 +44,7 @@ #include "ntqeventloop.h" #include "ntqapplication.h" #include "ntqbitarray.h" +#include "ntqmutex.h" #include <stdlib.h> #include <sys/types.h> @@ -369,9 +370,9 @@ void TQEventLoop::registerSocketNotifier( TQSocketNotifier *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 TQPtrList<TQSockNotGPollFD> *list = &d->sn_list; TQSockNotGPollFD *sn; @@ -424,9 +425,9 @@ void TQEventLoop::unregisterSocketNotifier( TQSocketNotifier *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 TQPtrList<TQSockNotGPollFD> *list = &d->sn_list; TQSockNotGPollFD *sn; @@ -457,9 +458,9 @@ void TQEventLoop::setSocketNotifierPending( TQSocketNotifier *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 TQPtrList<TQSockNotGPollFD> *list = &d->sn_list; TQSockNotGPollFD *sn; @@ -505,7 +506,9 @@ void TQEventLoop::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 TQEventLoop::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; - TQApplication::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; + TQApplication::sendEvent( sn->obj, &event ); + n_act++; + } } return n_act; |