Skip to content
This repository was archived by the owner on Jan 11, 2026. It is now read-only.

Commit b77c4bf

Browse files
committed
more error messages
1 parent 485d7e9 commit b77c4bf

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

ccminer.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,13 +1037,23 @@ static void workio_cmd_free(struct workio_cmd *wc)
10371037
{
10381038
case WC_SUBMIT_WORK:
10391039
free(wc->work);
1040+
if(errno)
1041+
{
1042+
applog(LOG_ERR, "free() error in workio_cmd_free: %s", strerror(errno));
1043+
errno = 0;
1044+
}
10401045
break;
10411046
default: /* do nothing */
10421047
break;
10431048
}
10441049

10451050
memset(wc, 0, sizeof(*wc)); /* poison */
10461051
free(wc);
1052+
if(errno)
1053+
{
1054+
applog(LOG_ERR, "free() error in workio_cmd_free: %s", strerror(errno));
1055+
errno = 0;
1056+
}
10471057
}
10481058

10491059
static bool workio_get_work(struct workio_cmd *wc, CURL *curl)

util.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2086,6 +2086,11 @@ void tq_free(struct thread_q *tq)
20862086

20872087
memset(tq, 0, sizeof(*tq)); /* poison */
20882088
free(tq);
2089+
if(errno)
2090+
{
2091+
applog(LOG_ERR, "free() error in tq_free: %s", strerror(errno));
2092+
errno = 0;
2093+
}
20892094
}
20902095

20912096
static void tq_freezethaw(struct thread_q *tq, bool frozen)
@@ -2133,6 +2138,11 @@ bool tq_push(struct thread_q *tq, void *data)
21332138
else
21342139
{
21352140
free(ent);
2141+
if(errno)
2142+
{
2143+
applog(LOG_ERR, "free() error in tq_push: %s", strerror(errno));
2144+
errno = 0;
2145+
}
21362146
rc = false;
21372147
}
21382148

@@ -2168,6 +2178,11 @@ void *tq_pop(struct thread_q *tq, const struct timespec *abstime)
21682178

21692179
list_del(&ent->q_node);
21702180
free(ent);
2181+
if(errno)
2182+
{
2183+
applog(LOG_ERR, "free() error in tq_pop: %s", strerror(errno));
2184+
errno = 0;
2185+
}
21712186

21722187
out:
21732188
pthread_mutex_unlock(&tq->mutex);

0 commit comments

Comments
 (0)