From 2fc71fe5635300526b0ad9bbcbc60da2b102d6a1 Mon Sep 17 00:00:00 2001 From: Tilghman Lesher Date: Tue, 13 May 2008 18:36:13 +0000 Subject: [PATCH] If the socket dies (read returns 0=EOF), return immediately. (Closes issue #12637) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115884 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- main/asterisk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/asterisk.c b/main/asterisk.c index 37823e9891..934a617317 100644 --- a/main/asterisk.c +++ b/main/asterisk.c @@ -2307,7 +2307,7 @@ static void ast_remotecontrol(char * data) char buf[512] = "", *curline = buf, *nextline; int not_written = 1; - if (read(ast_consock, buf, sizeof(buf) - 1) < 0) { + if (read(ast_consock, buf, sizeof(buf) - 1) <= 0) { break; }