changeset 3014:16576e05b93a

Profiling fix by Artur Skawina <skawina@geocities.com>
author atmos4
date Tue, 20 Nov 2001 00:23:49 +0000
parents 71384f064a3e
children 8bf21c807656
files fifo.c linux/getch2.c
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/fifo.c	Mon Nov 19 22:20:30 2001 +0000
+++ b/fifo.c	Tue Nov 20 00:23:49 2001 +0000
@@ -51,7 +51,7 @@
            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 @@
            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);
            }
--- a/linux/getch2.c	Mon Nov 19 22:20:30 2001 +0000
+++ b/linux/getch2.c	Tue Nov 20 00:23:49 2001 +0000
@@ -130,7 +130,7 @@
     /* 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;