aboutsummaryrefslogtreecommitdiffhomepage
path: root/reader.c
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2005-10-20 22:06:10 +1000
committerGravatar axel <axel@liljencrantz.se>2005-10-20 22:06:10 +1000
commit14204134bfdff8335adf06d94c092cb8e0774bd9 (patch)
tree9fe40419d91ee18a95e82b5833dc57ef2d697388 /reader.c
parent63b122b36918e4cc3571ce465b12c6b8db2c19de (diff)
Minor edits
darcs-hash:20051020120610-ac50b-62950ed81377c38979ea2967f915eaa0e7f01e33.gz
Diffstat (limited to 'reader.c')
-rw-r--r--reader.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/reader.c b/reader.c
index a553ce95..f577a666 100644
--- a/reader.c
+++ b/reader.c
@@ -2377,23 +2377,25 @@ static int read_i()
return 0;
}
+/**
+ Test if there are bytes available for reading on the specified file
+ descriptor
+*/
static int can_read( int fd )
{
- struct pollfd pfd =
- {
- fd, POLLIN, 0
- }
+ struct pollfd pfd[] =
+ {
+ {
+ fd, POLLIN, 0
+ }
+ }
;
- switch( poll( &pfd, 1, 0 ) )
- {
- case 1:
- return 1;
- }
- return 0;
+ return poll( pfd, 1, 0 ) == 1;
}
/**
- Test if the specified character is in the private use area that fish uses to store internal characters
+ Test if the specified character is in the private use area that
+ fish uses to store internal characters
*/
static int wchar_private( wchar_t c )
{