Browse Source

Merge commit '13820bf' into bfgminer-2.10.x

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

+ 11 - 12
miner.c

@@ -159,11 +159,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;
@@ -7813,14 +7812,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(&qd_lock);
 	mutex_init(&qd_lock);
 	mutex_init(&console_lock);
 	mutex_init(&console_lock);
@@ -7944,6 +7935,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);