In the main loop of the router: if the select call fails for
authorscottmk <scottmk@9efc2488-bf62-4759-914b-345cdb29e865>
Tue, 3 Nov 2009 00:00:59 +0000 (00:00 +0000)
committerscottmk <scottmk@9efc2488-bf62-4759-914b-345cdb29e865>
Tue, 3 Nov 2009 00:00:59 +0000 (00:00 +0000)
any reason other than an harmless signal (i.e. one whose
handler didn't set a switch to stop the loop), then break
out of the loop and terminate.

The old code would ignore the error and keep looping, using up
ca. 98% of the CPU until somebody killed it.

M    src/router/osrf_router.c

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1839 9efc2488-bf62-4759-914b-345cdb29e865

src/router/osrf_router.c

index 28bd36a..7e162b8 100644 (file)
@@ -195,9 +195,9 @@ void osrfRouterRun( osrfRouter* router ) {
                                else
                                        continue;    // Irrelevant signal; ignore it
                        } else {
-                               osrfLogWarning( OSRF_LOG_MARK,
-                                               "Top level select call failed with errno %d", errno);
-                               continue;
+                               osrfLogWarning( OSRF_LOG_MARK, "Top level select call failed with errno %d: %s",
+                                               errno, strerror( errno ) );
+                               break;
                        }
                }