From 4faa3b65abad58a20c5e7e401361d30188460a83 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Tue, 17 Aug 2004 22:54:16 +0000 Subject: Better message handling when buffer runs out of memory. --- common/buffer.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'common') diff --git a/common/buffer.c b/common/buffer.c index 6064cbe..cc5480f 100644 --- a/common/buffer.c +++ b/common/buffer.c @@ -71,7 +71,6 @@ void buffer_bump(ha_buffer_t* buf, int count) intl = (internal_t*)malloc(allocated); if(!intl) { - ha_messagex(NULL, LOG_CRIT, "out of memory"); buf->_dt = NULL; buf->_pp = buf->_rp = NULL; return; @@ -221,10 +220,10 @@ int ha_bufreadline(int fd, ha_buffer_t* buf) /* Fatal errors */ else if(l == -1) { - if(errno != EINTR) - ha_message(NULL, LOG_ERR, "couldn't read data"); + if(errno == EINTR) + return 0; - return 0; + return -1; } } -- cgit v1.2.3