aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2005-05-17 18:30:44 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2005-05-17 18:30:44 +0000
commiteed311e230dd674f975879037e09db036496029b (patch)
tree1dc2f5d9f232d20f93743dfe04d68b6db17db719
parent80078366b962dc881e6567e60bafe4de23bf1a27 (diff)
remove call to pall on unitialied fds
This function assumes that the fd is nonblocking (bug #4053) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5710 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-xmanager.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/manager.c b/manager.c
index 6e4812e9c..11c671c48 100755
--- a/manager.c
+++ b/manager.c
@@ -87,6 +87,10 @@ static struct mansession *sessions = NULL;
static struct manager_action *first_action = NULL;
AST_MUTEX_DEFINE_STATIC(actionlock);
+/* If you are calling carefulwrite, it is assumed that you are calling
+ it on a file descriptor that _DOES_ have NONBLOCK set. This way,
+ there is only one system call made to do a write, unless we actually
+ have a need to wait. This way, we get better performance. */
int ast_carefulwrite(int fd, char *s, int len, int timeoutms)
{
/* Try to write string, but wait no more than ms milliseconds
@@ -94,10 +98,6 @@ 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;