Browse Source

Bugfix: minergate: Claim socket before we initialise a cgpu for it

Luke Dashjr 11 years ago
parent
commit
d94302bce7
1 changed files with 4 additions and 0 deletions
  1. 4 0
      driver-minergate.c

+ 4 - 0
driver-minergate.c

@@ -26,6 +26,7 @@
 
 #include "deviceapi.h"
 #include "logging.h"
+#include "lowlevel.h"
 #include "miner.h"
 
 #define MINERGATE_MAX_NONCE_DIFF  0x20
@@ -153,6 +154,9 @@ bool minergate_detect_one(const char * const devpath)
 	if (responses > minergate_max_responses)
 		return_via_applog(out, , LOG_DEBUG, "%s: %s: More than maximum responses", minergate_drv.dname, devpath);
 	
+	if (bfg_claim_any2(&minergate_drv, devpath, "unix", devpath))
+		goto out;
+	
 	struct cgpu_info * const cgpu = malloc(sizeof(*cgpu));
 	*cgpu = (struct cgpu_info){
 		.drv = &minergate_drv,