Merge branch 'master' of https://github.com/ckolivas/cgminer
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
diff --git a/cgminer.c b/cgminer.c
index 613b406..756e005 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -69,9 +69,7 @@ enum workio_commands {
struct workio_cmd {
enum workio_commands cmd;
struct thr_info *thr;
- union {
- struct work *work;
- } u;
+ struct work *work;
bool lagging;
};
@@ -1906,7 +1904,7 @@ static void workio_cmd_free(struct workio_cmd *wc)
switch (wc->cmd) {
case WC_SUBMIT_WORK:
- free_work(wc->u.work);
+ free_work(wc->work);
break;
default: /* do nothing */
break;
@@ -2220,7 +2218,7 @@ static void check_solve(struct work *work)
static void *submit_work_thread(void *userdata)
{
struct workio_cmd *wc = (struct workio_cmd *)userdata;
- struct work *work = wc->u.work;
+ struct work *work = wc->work;
struct pool *pool = work->pool;
struct curl_ent *ce;
int failures = 0;
@@ -3852,11 +3850,11 @@ bool submit_work_sync(struct thr_info *thr, const struct work *work_in)
return false;
}
- wc->u.work = make_work();
+ wc->work = make_work();
wc->cmd = WC_SUBMIT_WORK;
wc->thr = thr;
- memcpy(wc->u.work, work_in, sizeof(*work_in));
- wc->u.work->share_found_time = time(NULL);
+ memcpy(wc->work, work_in, sizeof(*work_in));
+ wc->work->share_found_time = time(NULL);
applog(LOG_DEBUG, "Pushing submit work to work thread");
diff --git a/driver-ztex.c b/driver-ztex.c
index e38be74..db22392 100644
--- a/driver-ztex.c
+++ b/driver-ztex.c
@@ -63,7 +63,8 @@ static void ztex_detect(void)
struct cgpu_info *ztex;
cnt = libztex_scanDevices(&ztex_devices);
- applog(LOG_WARNING, "Found %d ztex board(s)", cnt);
+ if (cnt > 0)
+ applog(LOG_WARNING, "Found %d ztex board%s", cnt, cnt > 1 ? "s" : "");
for (i = 0; i < cnt; i++) {
ztex = calloc(1, sizeof(struct cgpu_info));
diff --git a/fpgautils.c b/fpgautils.c
index 79da854..12e3847 100644
--- a/fpgautils.c
+++ b/fpgautils.c
@@ -159,6 +159,7 @@ serial_open(const char*devpath, unsigned long baud, signed short timeout, bool p
applog(LOG_ERR, "%s is already in use by another process", devpath);
break;
default:
+ applog(LOG_DEBUG, "Open %s failed, GetLastError:%u", devpath, e);
break;
}
return -1;
@@ -196,6 +197,9 @@ serial_open(const char*devpath, unsigned long baud, signed short timeout, bool p
{
if (errno == EACCES)
applog(LOG_ERR, "Do not have user privileges required to open %s", devpath);
+ else
+ applog(LOG_DEBUG, "Open %s failed, errno:%d", devpath, errno);
+
return -1;
}