summaryrefslogtreecommitdiff
path: root/src/bootchart/svg.c
diff options
context:
space:
mode:
authorNathaniel Chen <nathaniel.chen@intel.com>2013-03-07 11:09:16 -0800
committerLennart Poettering <lennart@poettering.net>2013-03-07 20:53:14 +0100
commit0ea9530d401827e299c6e04a433e69a7a2a89d80 (patch)
tree8a7ef96d49837a24db4afe3bc481e10d1f88647c /src/bootchart/svg.c
parentffbd2c4d45787ba5ba85a32db6551efba66a1ee6 (diff)
bootchart: use _cleanup_close_
use _cleanup_{close_,fclose_} to close streams and file descriptors
Diffstat (limited to 'src/bootchart/svg.c')
-rw-r--r--src/bootchart/svg.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/bootchart/svg.c b/src/bootchart/svg.c
index 9fee810795..79476716a6 100644
--- a/src/bootchart/svg.c
+++ b/src/bootchart/svg.c
@@ -150,7 +150,7 @@ static void svg_title(const char *build)
char date[256] = "Unknown";
char cpu[256] = "Unknown";
char *c;
- FILE *f;
+ FILE _cleanup_fclose_ *f = NULL;
time_t t;
int fd;
struct utsname uts;
@@ -161,7 +161,6 @@ static void svg_title(const char *build)
if (f) {
if (!fgets(cmdline, 255, f))
sprintf(cmdline, "Unknown");
- fclose(f);
}
/* extract root fs so we can find disk model name in sysfs */
@@ -176,7 +175,6 @@ static void svg_title(const char *build)
if (f) {
if (!fgets(model, 255, f))
fprintf(stderr, "Error reading disk model for %s\n", rootbdev);
- fclose(f);
}
}
@@ -198,7 +196,6 @@ static void svg_title(const char *build)
break;
}
}
- fclose(f);
}
svg("<text class=\"t1\" x=\"0\" y=\"30\">Bootchart for %s - %s</text>\n",