mirror of
https://github.com/clearlinux/systemd-stable.git
synced 2026-09-06 21:51:37 +00:00
bootchart: check return of fopen before setvbuf in log.c
This commit is contained in:
committed by
Kay Sievers
parent
3c123e0899
commit
0908dd2fd5
+1
-1
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user