scsh-checkins
[Top] [All Lists]

[Scsh-checkins] CVS: scsh-0.6/c/unix fd-io.c,1.1.1.1,1.2

To: scsh-checkins@lists.sourceforge.net
Subject: [Scsh-checkins] CVS: scsh-0.6/c/unix fd-io.c,1.1.1.1,1.2
From: Martin Gasbichler <mainzelm@users.sourceforge.net>
Date: Fri, 23 Mar 2001 02:59:09 -0800
List-id: <scsh-checkins.lists.sourceforge.net>
Sender: scsh-checkins-admin@lists.sourceforge.net
Update of /cvsroot/scsh/scsh-0.6/c/unix
In directory usw-pr-cvs1:/tmp/cvs-serv28215/c/unix

Modified Files:
        fd-io.c 
Log Message:
Adapted some of Richard's changes for char-ready? and output-port-ready?.


Index: fd-io.c
===================================================================
RCS file: /cvsroot/scsh/scsh-0.6/c/unix/fd-io.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** fd-io.c     1999/09/14 12:44:53     1.1.1.1
--- fd-io.c     2001/03/23 10:59:07     1.2
***************
*** 83,86 ****
--- 83,115 ----
  }
  
+ bool ps_check_fd(long fd_as_long, bool is_read, long *status)
+ {
+   int fd = (int)fd_as_long;
+   int ready;
+ 
+   struct timeval timeout;
+   fd_set fds;
+ 
+   FD_ZERO(&fds);
+   FD_SET(fd, &fds);
+   timerclear(&timeout);
+ 
+   *status = NO_ERRORS;
+ 
+   while(TRUE) {
+     ready = select(fd + 1,
+                  is_read ? &fds : NULL,
+                  is_read ? NULL : &fds,
+                  &fds,
+                  &timeout);
+     if (ready == 0)
+       return FALSE;
+     else if (ready == 1)
+       return TRUE;
+     else if (errno != EINTR) {
+       *status = errno;
+       return FALSE; } } 
+ }
+ 
  long
  ps_read_fd(long fd_as_long, char *buffer, long max, bool waitp,



<Prev in Thread] Current Thread [Next in Thread>
  • [Scsh-checkins] CVS: scsh-0.6/c/unix fd-io.c,1.1.1.1,1.2, Martin Gasbichler <=