29a30
> #include <sys/poll.h>
854a856,859
> 
>   /*
>    * TODO: compare this with sshfs.c where the prompt appears on stdin_fd
>    */
867,874c872,878
<       FD_ZERO (&ifds);
<       FD_SET (stdout_fd, &ifds);
<       FD_SET (prompt_fd, &ifds);
<       
<       tv.tv_sec = SFTP_READ_TIMEOUT;
<       tv.tv_usec = 0;
<       
<       ret = select (MAX (stdout_fd, prompt_fd)+1, &ifds, NULL, NULL, &tv);
---
>       struct pollfd fds[2];
>       fds[0].fd = stdout_fd;
>       fds[0].events = POLLIN;
>       fds[1].fd = prompt_fd;
>       fds[1].events = POLLIN;
> 
>       ret = poll(fds, 2, SFTP_READ_TIMEOUT);
885c889
<       if (FD_ISSET (stdout_fd, &ifds))
---
>       if (fds[0].revents)
887,889c891,893
<       
<       g_assert (FD_ISSET (prompt_fd, &ifds));
<       
---
> 
>       if (!(fds[1].revents & POLLIN)) 
>         continue;
