From 27af41e5620ab9c5dc5fb27f508d2df21e1808b5 Mon Sep 17 00:00:00 2001 From: Marcelo Roberto Jimenez Date: Fri, 9 Nov 2007 11:48:30 +0000 Subject: [PATCH] Avoid 100% CPU in case of repeated error in select(). git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@242 119443c7-1b9e-41f8-b6fc-b9c35fce742c --- upnp/src/genlib/miniserver/miniserver.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/upnp/src/genlib/miniserver/miniserver.c b/upnp/src/genlib/miniserver/miniserver.c index f8c441d..5f08443 100644 --- a/upnp/src/genlib/miniserver/miniserver.c +++ b/upnp/src/genlib/miniserver/miniserver.c @@ -416,6 +416,8 @@ RunMiniServer( MiniServerSockArray * miniSock ) UPNP_SOCKETERROR ) { UpnpPrintf( UPNP_CRITICAL, SSDP, __FILE__, __LINE__, "Error in select call!\n" ); + /* Avoid 100% CPU in case of repeated error in select() */ + isleep( 1 ); continue; } else { if( FD_ISSET( miniServSock, &rdSet ) ) {