base: Add more detail to FD_SETSIZE related error message
authorNiklas Hamb├╝chen <mail@nh2.me>
Tue, 19 Sep 2017 19:14:27 +0000 (15:14 -0400)
committerBen Gamari <ben@smart-cactus.org>
Tue, 19 Sep 2017 19:58:46 +0000 (15:58 -0400)
Reviewers: bgamari, austin, hvr

Reviewed By: bgamari

Subscribers: rwbarton, thomie

Differential Revision: https://phabricator.haskell.org/D3960

libraries/base/cbits/inputReady.c

index 916633c..481c9de 100644 (file)
@@ -80,8 +80,7 @@ fdReady(int fd, int write, int msecs, int isSock)
         struct timeval remaining_tv;
 
         if ((fd >= (int)FD_SETSIZE) || (fd < 0)) {
-            fprintf(stderr, "fdReady: fd is too big");
-            abort();
+            barf("fdReady: fd is too big: %d but FD_SETSIZE is %d", fd, (int)FD_SETSIZE);
         }
         FD_ZERO(&rfd);
         FD_ZERO(&wfd);