]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/bootchart/bootchart.c
util-lib: split our string related calls from util.[ch] into its own file string...
[thirdparty/systemd.git] / src / bootchart / bootchart.c
index b4047b0d1456624f857a9a06ee8d35d6a11e9072..7842e0766db530d071724c95a636e4bad6ea5350 100644 (file)
 
  ***/
 
-#include <sys/resource.h>
-#include <stdio.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <getopt.h>
+#include <limits.h>
 #include <signal.h>
+#include <stdbool.h>
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <unistd.h>
+#include <sys/resource.h>
 #include <time.h>
-#include <getopt.h>
-#include <limits.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <stdbool.h>
-#include "systemd/sd-journal.h"
+#include <unistd.h>
 
-#include "util.h"
+#include "sd-journal.h"
+
+#include "bootchart.h"
+#include "conf-parser.h"
 #include "fileio.h"
+#include "list.h"
 #include "macro.h"
-#include "conf-parser.h"
-#include "strxcpyx.h"
 #include "path-util.h"
 #include "store.h"
+#include "string-util.h"
+#include "strxcpyx.h"
 #include "svg.h"
-#include "bootchart.h"
-#include "list.h"
+#include "util.h"
 
 static int exiting = 0;
 
@@ -457,10 +459,7 @@ int main(int argc, char *argv[]) {
                 ps = ps->next_ps;
                 ps->schedstat = safe_close(ps->schedstat);
                 ps->sched = safe_close(ps->sched);
-                if (ps->smaps) {
-                        fclose(ps->smaps);
-                        ps->smaps = NULL;
-                }
+                ps->smaps = safe_fclose(ps->smaps);
         }
 
         if (!of) {