From 5f2c4f13f9d36b640730b4aaad59db7c065d2b39 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Mon, 3 Jun 2013 11:28:18 +1000 Subject: [PATCH] Do not hotplug enable a device if devices have been specified and the hotplug device falls outside this range. --- cgminer.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cgminer.c b/cgminer.c index 4e3907d6..8cebb2a1 100644 --- a/cgminer.c +++ b/cgminer.c @@ -7140,8 +7140,12 @@ static void hotplug_process() int i, j; for (i = 0; i < new_devices; i++) { - struct cgpu_info *cgpu = devices[total_devices + i]; - enable_device(cgpu); + struct cgpu_info *cgpu; + int dev_no = total_devices + i; + + cgpu = devices[dev_no]; + if (!opt_devs_enabled || (opt_devs_enabled && devices_enabled[dev_no])) + enable_device(cgpu); cgpu->cgminer_stats.getwork_wait_min.tv_sec = MIN_SEC_UNSET; cgpu->rolling = cgpu->total_mhashes = 0; }