Skip to content

Commit

Permalink
rpc2: fix some warnings seen with gcc 4.9
Browse files Browse the repository at this point in the history
  • Loading branch information
tpruvot committed Jul 15, 2015
1 parent ad7d583 commit 9b7974b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cpu-miner.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ static struct option const options[] = {
{ 0, 0, 0, 0 }
};

static struct work g_work = { 0 };
static struct work g_work = {{ 0 }};
static time_t g_work_time = 0;
static pthread_mutex_t g_work_lock;
static bool submit_old = false;
Expand Down Expand Up @@ -1076,8 +1076,8 @@ static bool submit_upstream_work(CURL *curl, struct work *work)
if (valid)
share_result(valid, work, NULL);
else {
json_t *error = json_object_get(res, "error");
const char *sreason = json_string_value(json_object_get(res, "message"));
json_t *err = json_object_get(res, "error");
const char *sreason = json_string_value(json_object_get(err, "message"));
share_result(valid, work, sreason);
if (!strcasecmp("Invalid job id", sreason)) {
work_free(work);
Expand Down Expand Up @@ -2125,12 +2125,12 @@ static void *longpoll_thread(void *userdata)
int err;

if (jsonrpc_2) {
char s[128];
pthread_mutex_lock(&rpc2_login_lock);
if (rpc2_id && !strlen(rpc2_id)) {
if (!strlen(rpc2_id)) {
sleep(1);
continue;
}
char s[128];
snprintf(s, 128, "{\"method\": \"getjob\", \"params\": {\"id\": \"%s\"}, \"id\":1}\r\n", rpc2_id);
pthread_mutex_unlock(&rpc2_login_lock);
val = json_rpc2_call(curl, rpc_url, rpc_userpass, s, &err, JSON_RPC_LONGPOLL);
Expand Down

0 comments on commit 9b7974b

Please sign in to comment.