Browse Source

Merge commit '13f729c' into bfgminer

Luke Dashjr 12 years ago
parent
commit
bf1b8bf744
3 changed files with 8 additions and 2 deletions
  1. 1 1
      miner.c
  2. 6 1
      util.c
  3. 1 0
      util.h

+ 1 - 1
miner.c

@@ -8659,7 +8659,7 @@ static void *watchdog_thread(void __maybe_unused *userdata)
 					       dev_str);
 					device_recovered(cgpu);
 				}
-				dev_error(cgpu, REASON_DEV_THERMAL_CUTOFF);
+				dev_error_update(cgpu, REASON_DEV_THERMAL_CUTOFF);
 				continue;
 			}
 			else

+ 6 - 1
util.c

@@ -2250,11 +2250,16 @@ bool restart_stratum(struct pool *pool)
 	return true;
 }
 
-void dev_error(struct cgpu_info *dev, enum dev_reason reason)
+void dev_error_update(struct cgpu_info *dev, enum dev_reason reason)
 {
 	dev->device_last_not_well = time(NULL);
 	cgtime(&dev->tv_device_last_not_well);
 	dev->device_not_well_reason = reason;
+}
+
+void dev_error(struct cgpu_info *dev, enum dev_reason reason)
+{
+	dev_error_update(dev, reason);
 
 	switch (reason) {
 		case REASON_THREAD_FAIL_INIT:

+ 1 - 0
util.h

@@ -124,6 +124,7 @@ bool auth_stratum(struct pool *pool);
 bool initiate_stratum(struct pool *pool);
 bool restart_stratum(struct pool *pool);
 void suspend_stratum(struct pool *pool);
+extern void dev_error_update(struct cgpu_info *, enum dev_reason);
 void dev_error(struct cgpu_info *dev, enum dev_reason reason);
 void *realloc_strcat(char *ptr, char *s);
 extern char *sanestr(char *o, char *s);