aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-05-15 02:54:47 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-05-15 02:54:47 +0000
commitc3b40fbb666414f4d5e5a1ae63272a79d438af88 (patch)
treecd7805ea1cf1571ac31823a13ebe4c6eca7692e8
parent593a3886ae6fdb500c093d28fb4bc7c8d2e7de68 (diff)
fix for dead manager connections to avoid deadlock (bug #4053)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5661 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-xmanager.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/manager.c b/manager.c
index 8b8c66bb1..7f8df8bd7 100755
--- a/manager.c
+++ b/manager.c
@@ -94,6 +94,10 @@ int ast_carefulwrite(int fd, char *s, int len, int timeoutms)
int res=0;
struct pollfd fds[1];
while(len) {
+ /* Wait until writable */
+ res = poll(fds, 1, timeoutms);
+ if (res < 1)
+ return -1;
res = write(fd, s, len);
if ((res < 0) && (errno != EAGAIN)) {
return -1;