1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 09:21:26 +03:00

bootchart: check return of fopen before setvbuf in log.c

This commit is contained in:
Lukas Nykryn 2013-01-09 17:10:57 +01:00 committed by Kay Sievers
parent 3c123e0899
commit 0908dd2fd5

View File

@ -364,9 +364,9 @@ schedstat_next:
if (!ps->smaps) { if (!ps->smaps) {
sprintf(filename, "/proc/%d/smaps", pid); sprintf(filename, "/proc/%d/smaps", pid);
ps->smaps = fopen(filename, "r"); ps->smaps = fopen(filename, "r");
setvbuf(ps->smaps, smaps_buf, _IOFBF, sizeof(smaps_buf));
if (!ps->smaps) if (!ps->smaps)
continue; continue;
setvbuf(ps->smaps, smaps_buf, _IOFBF, sizeof(smaps_buf));
} else { } else {
rewind(ps->smaps); rewind(ps->smaps);
} }