diff options
author | laforge <laforge@99fdad57-331a-0410-800a-d7fa5415bdb3> | 2007-01-10 12:47:01 +0000 |
---|---|---|
committer | laforge <laforge@99fdad57-331a-0410-800a-d7fa5415bdb3> | 2007-01-10 12:47:01 +0000 |
commit | 031686b50aecd37ef1f0832fb64b2415e5e4981e (patch) | |
tree | 0c531a26ca36b890d92f33244387a8e27acca635 /src/util | |
parent | 9e3d10bff235c44c3a4e9f4d8c0f46a571042be8 (diff) |
use non-blocking i/o to prevent missing of events
git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@532 99fdad57-331a-0410-800a-d7fa5415bdb3
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/shell.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/util/shell.c b/src/util/shell.c index 2875758..b90cd19 100644 --- a/src/util/shell.c +++ b/src/util/shell.c @@ -2,6 +2,7 @@ #include <string.h> #include <stdlib.h> #include <unistd.h> +#include <fcntl.h> #include <libgsmd/libgsmd.h> #include <libgsmd/voicecall.h> @@ -37,6 +38,9 @@ int shell_main(struct lgsm_handle *lgsmh) lgsm_register_handler(lgsmh, GSMD_MSG_PASSTHROUGH, &pt_msghandler); + fcntl(0, F_SETFD, O_NONBLOCK); + fcntl(lgsm_fd(lgsmh), F_SETFD, O_NONBLOCK); + FD_ZERO(&readset); while (1) { |