Blob Blame History Raw
diff -up nut-2.7.1/tools/nut-scanner/nut-scanner.c.pthreadfix nut-2.7.1/tools/nut-scanner/nut-scanner.c
--- nut-2.7.1/tools/nut-scanner/nut-scanner.c.pthreadfix	2014-02-27 11:37:57.045786437 +0100
+++ nut-2.7.1/tools/nut-scanner/nut-scanner.c	2014-02-27 11:39:02.591326696 +0100
@@ -532,25 +532,25 @@ display_help:
 	}
 
 #ifdef HAVE_PTHREAD
-	if( allow_usb && nutscan_avail_usb ) {
+	if( allow_usb && nutscan_avail_usb && thread[TYPE_USB]) {
 		pthread_join(thread[TYPE_USB],NULL);
 	}
-	if( allow_snmp && nutscan_avail_snmp ) {
+	if( allow_snmp && nutscan_avail_snmp && thread[TYPE_SNMP]) {
 		pthread_join(thread[TYPE_SNMP],NULL);
 	}
-	if( allow_xml && nutscan_avail_xml_http ) {
+	if( allow_xml && nutscan_avail_xml_http && thread[TYPE_XML]) {
 		pthread_join(thread[TYPE_XML],NULL);
 	}
-	if( allow_oldnut && nutscan_avail_nut ) {
+	if( allow_oldnut && nutscan_avail_nut && thread[TYPE_NUT]) {
 		pthread_join(thread[TYPE_NUT],NULL);
 	}
-	if( allow_avahi && nutscan_avail_avahi ) {
+	if( allow_avahi && nutscan_avail_avahi && thread[TYPE_AVAHI]) {
 		pthread_join(thread[TYPE_AVAHI],NULL);
 	}
-	if( allow_ipmi && nutscan_avail_ipmi ) {
+	if( allow_ipmi && nutscan_avail_ipmi && thread[TYPE_IPMI]) {
 		pthread_join(thread[TYPE_IPMI],NULL);
 	}
-	if (allow_eaton_serial) {
+	if (allow_eaton_serial && thread[TYPE_EATON_SERIAL]) {
 		pthread_join(thread[TYPE_EATON_SERIAL],NULL);
 	}
 #endif /* HAVE_PTHREAD */