mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-19 00:00:09 +00:00
fix for dead manager connections to avoid deadlock (bug #4053)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5661 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -94,6 +94,10 @@ int ast_carefulwrite(int fd, char *s, int len, int timeoutms)
|
|||||||
int res=0;
|
int res=0;
|
||||||
struct pollfd fds[1];
|
struct pollfd fds[1];
|
||||||
while(len) {
|
while(len) {
|
||||||
|
/* Wait until writable */
|
||||||
|
res = poll(fds, 1, timeoutms);
|
||||||
|
if (res < 1)
|
||||||
|
return -1;
|
||||||
res = write(fd, s, len);
|
res = write(fd, s, len);
|
||||||
if ((res < 0) && (errno != EAGAIN)) {
|
if ((res < 0) && (errno != EAGAIN)) {
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
Reference in New Issue
Block a user