chiark / gitweb /
man: bootchart: change /var/log to /run/log
[elogind.git] / src / bootchart / svg.c
index 156918a94bf7f79e865b0f2dda57ead92f7e795f..6ad7348ecbe76ff7302821c614fa7809bed31af1 100644 (file)
@@ -1,16 +1,24 @@
-/*
- * svg.c
- *
- * Copyright (C) 2009-2012 Intel Coproration
- *
- * Authors:
- *   Auke Kok <auke-jan.h.kok@intel.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; version 2
- * of the License.
- */
+/***
+  bootchart.c - This file is part of systemd-bootchart
+
+  Copyright (C) 2009-2013 Intel Coproration
+
+  Authors:
+    Auke Kok <auke-jan.h.kok@intel.com>
+
+  systemd is free software; you can redistribute it and/or modify it
+  under the terms of the GNU Lesser General Public License as published by
+  the Free Software Foundation; either version 2.1 of the License, or
+  (at your option) any later version.
+
+  systemd is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public License
+  along with systemd; If not, see <http://www.gnu.org/licenses/>.
+ ***/
 
 #include <stdio.h>
 #include <stdarg.h>
@@ -22,6 +30,8 @@
 #include <sys/utsname.h>
 
 #include "bootchart.h"
+#include "util.h"
+#include "macro.h"
 
 
 #define time_to_graph(t) ((t) * scale_x)
@@ -85,10 +95,10 @@ static void svg_header(void)
 
         /* write some basic info as a comment, including some help */
         svg("<!-- This file is a bootchart SVG file. It is best rendered in a browser -->\n");
-        svg("<!-- such as Chrome/Chromium, firefox. Other applications that render    -->\n");
-        svg("<!-- these files properly but much more slow are ImageMagick, gimp,      -->\n");
-        svg("<!-- inkscape, etc.. To display the files on your system, just point     -->\n");
-        svg("<!-- your browser to file:///var/log/ and click. This bootchart was      -->\n\n");
+        svg("<!-- such as Chrome, Chromium, or Firefox. Other applications that       -->\n");
+        svg("<!-- render these files properly but more slowly are ImageMagick, gimp,  -->\n");
+        svg("<!-- inkscape, etc. To display the files on your system, just point      -->\n");
+        svg("<!-- your browser to file:///run/log/ and click. This bootchart was      -->\n\n");
 
         svg("<!-- generated by bootchart version %s, running with options:  -->\n", VERSION);
         svg("<!-- hz=\"%f\" n=\"%d\" -->\n", hz, len);
@@ -702,7 +712,7 @@ static int ps_filter(struct ps_struct *ps)
 
 static void svg_do_initcall(int count_only)
 {
-        FILE *f;
+        FILE _cleanup_pclose_ *f = NULL;
         double t;
         char func[256];
         int ret;
@@ -787,8 +797,6 @@ static void svg_do_initcall(int count_only)
 
                 kcount++;
         }
-
-        fclose(f);
 }