Browse Source

Cope gracefully with the inability to fopen pool.status file.

master
Con Kolivas 7 years ago
parent
commit
aa2636cde8
  1. 6
      src/stratifier.c

6
src/stratifier.c

@ -8300,6 +8300,7 @@ static void *statsupdate(void *arg)
s = json_dumps(val, JSON_NO_UTF8 | JSON_PRESERVE_ORDER);
json_decref(val);
LOGNOTICE("Pool:%s", s);
if (likely(fp))
fprintf(fp, "%s\n", s);
dealloc(s);
@ -8314,6 +8315,7 @@ static void *statsupdate(void *arg)
s = json_dumps(val, JSON_NO_UTF8 | JSON_PRESERVE_ORDER);
json_decref(val);
LOGNOTICE("Pool:%s", s);
if (likely(fp))
fprintf(fp, "%s\n", s);
dealloc(s);
@ -8325,9 +8327,11 @@ static void *statsupdate(void *arg)
s = json_dumps(val, JSON_NO_UTF8 | JSON_PRESERVE_ORDER | JSON_REAL_PRECISION(3));
json_decref(val);
LOGNOTICE("Pool:%s", s);
if (likely(fp)) {
fprintf(fp, "%s\n", s);
dealloc(s);
fclose(fp);
}
dealloc(s);
if (ckp->proxy && sdata->proxy) {
proxy_t *proxy, *proxytmp, *subproxy, *subtmp;

Loading…
Cancel
Save