api - howoldsec is only used for USB
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
diff --git a/api.c b/api.c
index ed28b42..eebd2a0 100644
--- a/api.c
+++ b/api.c
@@ -2190,14 +2190,16 @@ static void devstatus(struct io_data *io_data, __maybe_unused SOCKETTYPE c, __ma
io_close(io_data);
}
-static void edevstatus(struct io_data *io_data, __maybe_unused SOCKETTYPE c, char *param, bool isjson, __maybe_unused char group)
+static void edevstatus(struct io_data *io_data, __maybe_unused SOCKETTYPE c, __maybe_unused char *param, bool isjson, __maybe_unused char group)
{
bool io_open = false;
int devcount = 0;
int numasc = 0;
int numpga = 0;
int i;
+#ifdef USE_USBUTILS
time_t howoldsec = 0;
+#endif
#ifdef HAVE_AN_ASIC
numasc = numascs();
@@ -2212,8 +2214,10 @@ static void edevstatus(struct io_data *io_data, __maybe_unused SOCKETTYPE c, cha
return;
}
+#ifdef USE_USBUTILS
if (param && *param)
howoldsec = (time_t)atoi(param);
+#endif
message(io_data, MSG_DEVS, 0, NULL, isjson);
if (isjson)
@@ -3315,17 +3319,19 @@ static void minerstats(struct io_data *io_data, __maybe_unused SOCKETTYPE c, __m
io_close(io_data);
}
-static void minerestats(struct io_data *io_data, __maybe_unused SOCKETTYPE c, char *param, bool isjson, __maybe_unused char group)
+static void minerestats(struct io_data *io_data, __maybe_unused SOCKETTYPE c, __maybe_unused char *param, bool isjson, __maybe_unused char group)
{
struct cgpu_info *cgpu;
bool io_open = false;
struct api_data *extra;
char id[20];
int i, j;
+#ifdef USE_USBUTILS
time_t howoldsec = 0;
if (param && *param)
howoldsec = (time_t)atoi(param);
+#endif
message(io_data, MSG_MINESTATS, 0, NULL, isjson);
if (isjson)