* init.c (scm_boot_guile): Don't return the value of
[bpt/guile.git] / libguile / filesys.c
index a50c2cd..1f65c88 100644 (file)
@@ -61,7 +61,7 @@
 #include <unistd.h>
 #endif
 
-#ifdef HAVE_LIBC_H
+#ifdef LIBC_H_WITH_UNISTD_H
 #include <libc.h>
 #endif
 
@@ -1125,14 +1125,7 @@ scm_input_waiting_p (f, caller)
 # endif
 
   /* Is the file prepared to deliver input? */
-# ifdef FIONREAD
-  {
-    long remir;
-    ioctl(fileno(f), FIONREAD, &remir);
-    return remir;
-  }
-# else
-#  ifdef HAVE_SELECT
+# ifdef HAVE_SELECT
   {
     struct timeval timeout;
     SELECT_TYPE read_set;
@@ -1157,8 +1150,15 @@ scm_input_waiting_p (f, caller)
     SCM_ALLOW_INTS;
     return FD_ISSET (fno, &read_set);
   }
+# else
+# ifdef FIONREAD
+  {
+    long remir;
+    ioctl(fileno(f), FIONREAD, &remir);
+    return remir;
+  }
 #  else    
-    return -1;
+  scm_misc_error ("char-ready?", "Not fully implemented\n");
 #  endif
 # endif
 }