17 Jan
2014
17 Jan
'14
5:23 p.m.
On Fri, Jan 17, 2014 at 05:26:26PM +0100, Daniel Willmann wrote:
- LOGP(DSMPP, LOGL_ERROR, "[%s] read returned %d\n", - esme->system_id, rc); + /* EINTR is a non-fatal error, just try again */ + if (errno == EINTR) + return 0;
if (rc < 0) { - LOGP(DSMPP, LOGL_ERROR, "[%s] read returned %d\n", - esme->system_id, rc); + LOGP(DSMPP, LOGL_ERROR, "[%s] read returned %d (%s)\n", + esme->system_id, rc, strerror(errno)); + goto dead_socket;
For reference. you should make the errno check in both cases or just simplify the reading part and move the error handling to a macro.