summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorLin Guo - Sun Microsystems <Lin.Guo@Sun.COM>2009-10-25 22:02:50 +0800
committerLin Guo - Sun Microsystems <Lin.Guo@Sun.COM>2009-10-25 22:02:50 +0800
commiteb1d81f3a9f8d0c56b7fca4667287a099fa49cfa (patch)
tree42c2cfc9172c4081c8f3196c73c6b65a7819c723 /usr/src
parentd744196318f8bf4407268965e338f2d4abce91d2 (diff)
downloadillumos-joyent-eb1d81f3a9f8d0c56b7fca4667287a099fa49cfa.tar.gz
6875964 hald-addon-network-discovery eats up CPU and seems to hang/loop
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/cmd/hal/addons/network-devices/snmp.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/usr/src/cmd/hal/addons/network-devices/snmp.c b/usr/src/cmd/hal/addons/network-devices/snmp.c
index 2213ba5049..80c793cc8a 100644
--- a/usr/src/cmd/hal/addons/network-devices/snmp.c
+++ b/usr/src/cmd/hal/addons/network-devices/snmp.c
@@ -1,12 +1,10 @@
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* Licensed under the Academic Free License version 2.1
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
@@ -26,7 +24,7 @@
#include "network-discovery.h"
#include "printer.h"
-#define NP(x) (x?x:"NULL")
+#define NP(x) (x?x:"NULL")
static GList *new_addrs = NULL;
@@ -75,7 +73,7 @@ scan_for_devices_using_snmp(LibHalContext *ctx, char *parent, char *community,
GList *elem;
HAL_DEBUG(("scan_for_devices_using_snmp(0x%8.8x, %s, %s, %s)",
- ctx, NP(parent), NP(community), NP(network)));
+ ctx, NP(parent), NP(community), NP(network)));
init_snmp("snmp-scan");
init_mib();
@@ -111,7 +109,7 @@ scan_for_devices_using_snmp(LibHalContext *ctx, char *parent, char *community,
fds = select(fds, &fdset, NULL, NULL, block ? NULL : &timeout);
if (fds < 0) {
perror("select failed");
- continue;
+ break;
} if (fds == 0) {
break;
} else {