--- ../hurdselect_orig.c 2012-10-21 22:55:26.000000000 +0200 +++ ../hurdselect_orig_timeout.c 2012-11-01 12:58:00.000000000 +0100 @@ -84,9 +84,13 @@ to = (timeout->tv_sec * 1000 + (timeout->tv_nsec + 999999) / 1000000); - if (strcmp(program_invocation_short_name, "vi") && strcmp(program_invocation_short_name, "vim") && strcmp(program_invocation_short_name, "vimdiff") && !to) - to = 1; } + /* XXX: A timeout of 0 returns immediately, even if no file + descriptors are ready. This is correct according to + POSIX.1-2001. As many programs rely on file descriptors being + ready for a timeout of zero use 1 msec as the minimum delay */ + if (to == 0) + to = 1; if (sigmask && __sigprocmask (SIG_SETMASK, sigmask, &oset)) return -1;