--- rxvt-unicode/src/init.C 2006/01/04 20:43:38 1.131 +++ rxvt-unicode/src/init.C 2006/01/06 02:11:15 1.132 @@ -1404,11 +1404,14 @@ { pty.pty = atoi (rs[Rs_pty_fd]); - if (getfd_hook) - pty.pty = (*getfd_hook) (pty.pty); + if (pty.pty >= 0) + { + if (getfd_hook) + pty.pty = (*getfd_hook) (pty.pty); - if (pty.pty < 0 || fcntl (pty.pty, F_SETFL, O_NONBLOCK)) - rxvt_fatal ("unusable pty-fd filehandle, aborting.\n"); + if (pty.pty < 0 || fcntl (pty.pty, F_SETFL, O_NONBLOCK)) + rxvt_fatal ("unusable pty-fd filehandle, aborting.\n"); + } } else #endif