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:
parent
3c123e0899
commit
0908dd2fd5
@ -364,9 +364,9 @@ schedstat_next:
|
||||
if (!ps->smaps) {
|
||||
sprintf(filename, "/proc/%d/smaps", pid);
|
||||
ps->smaps = fopen(filename, "r");
|
||||
setvbuf(ps->smaps, smaps_buf, _IOFBF, sizeof(smaps_buf));
|
||||
if (!ps->smaps)
|
||||
continue;
|
||||
setvbuf(ps->smaps, smaps_buf, _IOFBF, sizeof(smaps_buf));
|
||||
} else {
|
||||
rewind(ps->smaps);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user