Index: asterisk-1.2/res/res_agi.c =================================================================== --- asterisk-1.2/res/res_agi.c (revision 9322) +++ asterisk-1.2/res/res_agi.c (working copy) @@ -191,15 +191,19 @@ } pfds[0].fd = s; pfds[0].events = POLLOUT; - if (poll(pfds, 1, MAX_AGI_CONNECT) != 1) { - ast_log(LOG_WARNING, "Connect to '%s' failed!\n", agiurl); - close(s); - return -1; + while(poll(pfds, 1, MAX_AGI_CONNECT)!=1) { + if (errno != EINTR) { + ast_log(LOG_WARNING, "Connect to '%s' failed!\n", agiurl); + close(s); + return -1; + } } - if (write(s, "agi_network: yes\n", strlen("agi_network: yes\n")) < 0) { - ast_log(LOG_WARNING, "Connect to '%s' failed: %s\n", agiurl, strerror(errno)); - close(s); - return -1; + while(write(s, "agi_network: yes\n", strlen("agi_network: yes\n")) < 0) { + if (errno != EINTR) { + ast_log(LOG_WARNING, "Connect to '%s' failed: %s\n", agiurl, strerror(errno)); + close(s); + return -1; + } } /* If we have a script parameter, relay it to the fastagi server */