Browse Source

Merge commit '13820bf' into bfgminer

Luke Dashjr 12 years ago
parent
commit
e7e8e6215e
1 changed files with 11 additions and 12 deletions
  1. 11 12
      miner.c

+ 11 - 12
miner.c

@@ -183,11 +183,10 @@ bool use_curses = true;
 #else
 #else
 bool use_curses;
 bool use_curses;
 #endif
 #endif
-#ifdef HAVE_LIBUSB
-bool have_libusb = true;
-#else
-const bool have_libusb;
+#ifndef HAVE_LIBUSB
+const
 #endif
 #endif
+bool have_libusb;
 static bool opt_submit_stale = true;
 static bool opt_submit_stale = true;
 static int opt_shares;
 static int opt_shares;
 static int opt_submit_threads = 0x40;
 static int opt_submit_threads = 0x40;
@@ -9823,14 +9822,6 @@ int main(int argc, char *argv[])
 		initial_args[i] = strdup(argv[i]);
 		initial_args[i] = strdup(argv[i]);
 	initial_args[argc] = NULL;
 	initial_args[argc] = NULL;
 
 
-#ifdef HAVE_LIBUSB
-	int err = libusb_init(NULL);
-	if (err) {
-		applog(LOG_WARNING, "libusb_init() failed err %d", err);
-		have_libusb = false;
-	}
-#endif
-
 	mutex_init(&hash_lock);
 	mutex_init(&hash_lock);
 	mutex_init(&console_lock);
 	mutex_init(&console_lock);
 	cglock_init(&control_lock);
 	cglock_init(&control_lock);
@@ -9965,6 +9956,14 @@ int main(int argc, char *argv[])
 		enable_curses();
 		enable_curses();
 #endif
 #endif
 
 
+#ifdef HAVE_LIBUSB
+	int err = libusb_init(NULL);
+	if (err)
+		applog(LOG_WARNING, "libusb_init() failed err %d", err);
+	else
+		have_libusb = true;
+#endif
+
 	applog(LOG_WARNING, "Started %s", packagename);
 	applog(LOG_WARNING, "Started %s", packagename);
 	if (cnfbuf) {
 	if (cnfbuf) {
 		applog(LOG_NOTICE, "Loaded configuration file %s", cnfbuf);
 		applog(LOG_NOTICE, "Loaded configuration file %s", cnfbuf);