minissdpd.c: silently ignore EAGAIN, EWOULDBLOCK, EINTR of recv calls

This commit is contained in:
Thomas Bernard 2014-02-03 16:51:25 +01:00
parent 612d0e44fb
commit 178f0b8c4d
2 changed files with 13 additions and 3 deletions

View File

@ -1,4 +1,7 @@
$Id: Changelog.txt,v 1.32 2013/08/19 16:40:55 nanard Exp $
$Id: Changelog.txt,v 1.33 2014/02/03 15:45:07 nanard Exp $
2014/02/03:
silently ignore EAGAIN, EWOULDBLOCK, EINTR of recv calls
2013/08/19:
Translate README in english

View File

@ -224,6 +224,7 @@ SendSSDPMSEARCHResponse(int s, const struct sockaddr * sockname,
n = sendto(s, buf, l, 0,
sockname, sockname_len );
if(n < 0) {
/* XXX handle EINTR, EAGAIN, EWOULDBLOCK */
syslog(LOG_ERR, "sendto(udp): %m");
}
}
@ -1002,7 +1003,10 @@ int main(int argc, char * * argv)
(struct sockaddr *)&sendername6, &sendername6_len);
if(n<0)
{
syslog(LOG_ERR, "recvfrom: %m");
/* EAGAIN, EWOULDBLOCK, EINTR : silently ignore (try again next time)
* other errors : log to LOG_ERR */
if(errno != EAGAIN && errno != EWOULDBLOCK && errno != EINTR)
syslog(LOG_ERR, "recvfrom: %m");
}
else
{
@ -1033,7 +1037,10 @@ int main(int argc, char * * argv)
(struct sockaddr *)&sendername, &sendername_len);
if(n<0)
{
syslog(LOG_ERR, "recvfrom: %m");
/* EAGAIN, EWOULDBLOCK, EINTR : silently ignore (try again next time)
* other errors : log to LOG_ERR */
if(errno != EAGAIN && errno != EWOULDBLOCK && errno != EINTR)
syslog(LOG_ERR, "recvfrom: %m");
}
else
{