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