summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoratmos4 <atmos4@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-11-20 00:23:49 +0000
committeratmos4 <atmos4@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-11-20 00:23:49 +0000
commite7df17dcda08cb3bbb5d72494e4adae62721fa77 (patch)
tree9041be17534a048c2d2b1f59da641a7416a4f199
parent3c25d58ba326f40491e6222bcdb180a432495fb5 (diff)
downloadmpv-e7df17dcda08cb3bbb5d72494e4adae62721fa77.tar.bz2
mpv-e7df17dcda08cb3bbb5d72494e4adae62721fa77.tar.xz
Profiling fix by Artur Skawina <skawina@geocities.com>
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3015 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--fifo.c4
-rw-r--r--linux/getch2.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/fifo.c b/fifo.c
index 0c2b35048d..8f7d25505d 100644
--- a/fifo.c
+++ b/fifo.c
@@ -51,7 +51,7 @@ void mplayer_put_key(int code){
tv.tv_usec = 0;
//retval = select(keyb_fifo_put+1, &rfds, NULL, NULL, &tv);
- if(select(keyb_fifo_put+1, NULL, &rfds, NULL, &tv)){
+ if(select(keyb_fifo_put+1, NULL, &rfds, NULL, &tv)>0){
write(keyb_fifo_put,&code,4);
// printf("*** key event %d sent ***\n",code);
} else {
@@ -71,7 +71,7 @@ int mplayer_get_key(){
tv.tv_usec = 0;
//retval = select(keyb_fifo_put+1, &rfds, NULL, NULL, &tv);
- if(select(keyb_fifo_put+1, &rfds, NULL, NULL, &tv)){
+ if(select(keyb_fifo_put+1, &rfds, NULL, NULL, &tv)>0){
read(keyb_fifo_get,&code,4);
// printf("*** key event %d read ***\n",code);
}
diff --git a/linux/getch2.c b/linux/getch2.c
index 86161e2663..693f2afa0c 100644
--- a/linux/getch2.c
+++ b/linux/getch2.c
@@ -130,7 +130,7 @@ int getch2(int time){
/* Wait up to 'time' microseconds. */
tv.tv_sec=time/1000; tv.tv_usec = (time%1000)*1000;
retval=select(1, &rfds, NULL, NULL, &tv);
- if(!retval) return -1;
+ if(retval<=0) return -1;
/* Data is available now. */
retval=read(0,&getch2_buf[getch2_len],BUF_LEN-getch2_len);
if(retval<1) return -1;