Skip to content

Commit cf9bd0f

Browse files
committed
Loadavg (Linux): read /proc/loadavg instead of /proc/uptime
Fix #1206
1 parent 17deaf9 commit cf9bd0f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/detection/loadavg/loadavg_linux.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ const char* ffDetectLoadavg(double result[3])
99

1010
// Don't use syscall for container compatibility. #620
1111
char buf[64];
12-
ssize_t nRead = ffReadFileData("/proc/uptime", sizeof(buf) - 1, buf);
12+
ssize_t nRead = ffReadFileData("/proc/loadavg", sizeof(buf) - 1, buf);
1313
if (nRead > 0)
1414
{
1515
buf[nRead] = '\0';
1616

17-
if (sscanf(buf, "%lf %lf %lf", &result[0], &result[1], &result[2]) == 3)
17+
if (sscanf(buf, "%lf%lf%lf", &result[0], &result[1], &result[2]) == 3)
1818
return NULL;
1919
}
2020

0 commit comments

Comments
 (0)