summaryrefslogtreecommitdiff
path: root/src/bootchart/svg.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-03-07 15:28:03 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-03-07 15:35:50 -0500
commit1f3523baf7418adf3b2738b3917ef956a8414ab7 (patch)
tree334dde9e12ebf4cfc3ebf219adcb40aee664cf4d /src/bootchart/svg.c
parentdb7f1dde30068bd980c78db77867b6956f5295e2 (diff)
Revert "bootchart: use _cleanup_close_"
This reverts commit 0ea9530d401827e299c6e04a433e69a7a2a89d80. attribute(cleanup) can only be used inside functions (*of, sysfd are leaked). Cleanup functions are only called once when exiting scope (*f is leaked twice).
Diffstat (limited to 'src/bootchart/svg.c')
-rw-r--r--src/bootchart/svg.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/bootchart/svg.c b/src/bootchart/svg.c
index 79476716a6..9fee810795 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 _cleanup_fclose_ *f = NULL;
+ FILE *f;
time_t t;
int fd;
struct utsname uts;
@@ -161,6 +161,7 @@ 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 */
@@ -175,6 +176,7 @@ 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);
}
}
@@ -196,6 +198,7 @@ static void svg_title(const char *build)
break;
}
}
+ fclose(f);
}
svg("<text class=\"t1\" x=\"0\" y=\"30\">Bootchart for %s - %s</text>\n",