From 0908dd2fd5536cf15d75780980ac2eca37ff800f Mon Sep 17 00:00:00 2001 From: Lukas Nykryn Date: Wed, 9 Jan 2013 17:10:57 +0100 Subject: bootchart: check return of fopen before setvbuf in log.c --- src/bootchart/log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/bootchart/log.c') diff --git a/src/bootchart/log.c b/src/bootchart/log.c index 89c7b3523c..6c40913973 100644 --- a/src/bootchart/log.c +++ b/src/bootchart/log.c @@ -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); } -- cgit v1.2.3-54-g00ecf