author | mickeyl <mickeyl> | 2002-12-10 01:24:42 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2002-12-10 01:24:42 (UTC) |
commit | 448426777d9e35826898791d03b4bc71335427ff (patch) (side-by-side diff) | |
tree | dfc55fb0b22ea22e4b873da8b4329dc31f15ad8b /noncore/net/wellenreiter/gui/wellenreiter.cpp | |
parent | 8641065755bbb1e2ff96e7fb964d4b0cd91c65b6 (diff) | |
download | opie-448426777d9e35826898791d03b4bc71335427ff.zip opie-448426777d9e35826898791d03b4bc71335427ff.tar.gz opie-448426777d9e35826898791d03b4bc71335427ff.tar.bz2 |
towards an alpha version
Diffstat (limited to 'noncore/net/wellenreiter/gui/wellenreiter.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index 6d62fa8..3453d18 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp @@ -20,7 +20,9 @@ // Standard #include <assert.h> +#include <errno.h> #include <unistd.h> +#include <string.h> #include <sys/types.h> // Local @@ -131,23 +133,31 @@ bool Wellenreiter::hasMessage() tv.tv_sec = 0; tv.tv_usec = 10; int result = select( daemon_fd+1, &rfds, NULL, NULL, &tv ); - return FD_ISSET( daemon_fd, &rfds ); + + if ( result == 0 ) + { + return false; + } + else if ( result == -1 ) + { + qDebug( "selected returned: %s", strerror( errno ) ); + return false; + } + else + return true; //FD_ISSET( daemon_fd, &rfds ); gibbet 'eh nur einen Deskriptor } void Wellenreiter::timerEvent( QTimerEvent* e ) { qDebug( "checking for message..." ); - - int result = hasMessage(); - qDebug( "hasMessage() returned %d", result ); - - if ( result ) + if ( hasMessage() ) { + qDebug( "got message" ); handleMessage(); } else { - qDebug( "no message :(" ); + qDebug( "no message..." ); } } |