Author: cgutman
Date: Sat Aug 8 05:18:41 2009
New Revision: 42491
URL:
http://svn.reactos.org/svn/reactos?rev=42491&view=rev
Log:
- Stop trying to find more adapters if it failed to avoid spamming the debug log
- Should fix buildbot test 2nd stage
Modified:
trunk/reactos/base/services/dhcp/adapter.c
trunk/reactos/base/services/dhcp/dispatch.c
trunk/reactos/base/services/dhcp/include/rosdhcp.h
Modified: trunk/reactos/base/services/dhcp/adapter.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/dhcp/adapter…
==============================================================================
--- trunk/reactos/base/services/dhcp/adapter.c [iso-8859-1] (original)
+++ trunk/reactos/base/services/dhcp/adapter.c [iso-8859-1] Sat Aug 8 05:18:41 2009
@@ -229,12 +229,13 @@
/*
* XXX Figure out the way to bind a specific adapter to a socket.
*/
-void AdapterDiscover() {
+BOOLEAN AdapterDiscover() {
PMIB_IFTABLE Table = (PMIB_IFTABLE) malloc(sizeof(MIB_IFTABLE));
DWORD Error, Size = sizeof(MIB_IFTABLE);
PDHCP_ADAPTER Adapter = NULL;
struct interface_info *ifi = NULL;
int i;
+ BOOLEAN ret = TRUE;
DH_DbgPrint(MID_TRACE,("Getting Adapter List...\n"));
@@ -245,7 +246,10 @@
Table = (PMIB_IFTABLE) malloc( Size );
}
- if( Error != NO_ERROR ) goto term;
+ if( Error != NO_ERROR ) {
+ ret = FALSE;
+ goto term;
+ }
DH_DbgPrint(MID_TRACE,("Got Adapter List (%d entries)\n",
Table->dwNumEntries));
@@ -335,6 +339,7 @@
term:
if( Table ) free( Table );
+ return ret;
}
void AdapterStop() {
Modified: trunk/reactos/base/services/dhcp/dispatch.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/dhcp/dispatc…
==============================================================================
--- trunk/reactos/base/services/dhcp/dispatch.c [iso-8859-1] (original)
+++ trunk/reactos/base/services/dhcp/dispatch.c [iso-8859-1] Sat Aug 8 05:18:41 2009
@@ -77,7 +77,10 @@
* a timeout registered, time out the select call then.
*/
another:
- AdapterDiscover();
+ if (!AdapterDiscover()) {
+ AdapterStop();
+ break;
+ }
for (l = protocols, nfds = 0; l; l = l->next)
nfds++;
Modified: trunk/reactos/base/services/dhcp/include/rosdhcp.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/dhcp/include…
==============================================================================
--- trunk/reactos/base/services/dhcp/include/rosdhcp.h [iso-8859-1] (original)
+++ trunk/reactos/base/services/dhcp/include/rosdhcp.h [iso-8859-1] Sat Aug 8 05:18:41
2009
@@ -73,7 +73,8 @@
#define srandom srand
void AdapterInit(VOID);
-void AdapterDiscover(VOID);
+BOOLEAN AdapterDiscover(VOID);
+void AdapterStop(VOID);
HANDLE PipeInit(VOID);
extern PDHCP_ADAPTER AdapterGetFirst();
extern PDHCP_ADAPTER AdapterGetNext(PDHCP_ADAPTER);