From 25ca0687a1695179b7a25a8b29d97426f3647087 Mon Sep 17 00:00:00 2001 From: Kano Date: Fri, 23 Mar 2012 10:00:23 +1100 Subject: [PATCH] api.c notify should report disabled devices also - of course --- api.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/api.c b/api.c index a3582cf7..8c86252c 100644 --- a/api.c +++ b/api.c @@ -1660,17 +1660,9 @@ void notifystatus(int device, struct cgpu_info *cgpu, bool isjson) static void notify(__maybe_unused SOCKETTYPE c, __maybe_unused char *param, bool isjson) { - int devcount = 0; int i; - for (i = 0; i < total_devices; i++) { - if (devices[i]->deven == DEV_ENABLED) { - devcount++; - break; - } - } - - if (devcount == 0) { + if (total_devices == 0) { strcpy(io_buffer, message(MSG_NODEVS, 0, NULL, isjson)); return; } @@ -1682,10 +1674,8 @@ static void notify(__maybe_unused SOCKETTYPE c, __maybe_unused char *param, bool strcat(io_buffer, JSON_NOTIFY); } - devcount = 0; for (i = 0; i < total_devices; i++) - if (devices[i]->deven == DEV_ENABLED) - notifystatus(devcount++, devices[i], isjson); + notifystatus(i, devices[i], isjson); if (isjson) strcat(io_buffer, JSON_CLOSE);