aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_agi.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-02-15 00:38:27 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-02-15 00:38:27 +0000
commit1290482b558b082e2da704e42730716baa1b5349 (patch)
tree52c2fd872120ce4836fd2005f339dd1c72ba0007 /res/res_agi.c
parent8b1974448d10b4be7aba2e5e6dc7313bc1b58b84 (diff)
Merged revisions 10021,10108 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r10108 | kpfleming | 2006-02-14 18:36:57 -0600 (Tue, 14 Feb 2006) | 2 lines ensure that FastAGI launcher can handle system call interruption (issue #6449) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@10109 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_agi.c')
-rw-r--r--res/res_agi.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/res/res_agi.c b/res/res_agi.c
index ef7576fcd..2b27e745d 100644
--- a/res/res_agi.c
+++ b/res/res_agi.c
@@ -1,7 +1,7 @@
/*
* Asterisk -- An open source telephony toolkit.
*
- * Copyright (C) 1999 - 2005, Digium, Inc.
+ * Copyright (C) 1999 - 2006, Digium, Inc.
*
* Mark Spencer <markster@digium.com>
*
@@ -190,17 +190,23 @@ static int launch_netscript(char *agiurl, char *argv[], int *fds, int *efd, int
close(s);
return -1;
}
+
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: %s\n", agiurl, strerror(errno));
+ 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 */