qmemman: save a syscall in meminfo-writer via use of "pread"

This commit is contained in:
Rafal Wojtczuk 2010-09-10 14:53:41 +02:00
parent a2136c3d2b
commit 6d764ef50d

View File

@ -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);
}
}