qmemman: save a syscall in meminfo-writer via use of "pread"
This commit is contained in:
parent
6736081581
commit
d91c03358c
@ -111,12 +111,11 @@ int main(int argc, char **argv)
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
for (;;) {
|
for (;;) {
|
||||||
n = read(fd, buf, sizeof(buf));
|
n = pread(fd, buf, sizeof(buf), 0);
|
||||||
buf[n] = 0;
|
buf[n] = 0;
|
||||||
meminfo_data = parse(buf);
|
meminfo_data = parse(buf);
|
||||||
if (meminfo_data)
|
if (meminfo_data)
|
||||||
send_to_qmemman(xs, meminfo_data);
|
send_to_qmemman(xs, meminfo_data);
|
||||||
usleep(delay);
|
usleep(delay);
|
||||||
lseek(fd, 0, SEEK_SET);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user