int pscount;
 int cpus;
 double interval;
-FILE _cleanup_fclose_ *of = NULL;
+FILE *of = NULL;
 int overrun = 0;
 static int exiting = 0;
-int _cleanup_close_ sysfd=-1;
+int sysfd=-1;
 
 /* graph defaults */
 bool entropy = false;
         char datestr[200];
         time_t t = 0;
         const char *fn;
-        _cleanup_fclose_ FILE *f = NULL;
+        _cleanup_fclose_ FILE *f;
         int gind;
         int i, r;
         char *init = NULL, *output = NULL;
         svg_do(build);
 
         fprintf(stderr, "systemd-bootchart wrote %s\n", output_file);
+        fclose(of);
 
         closedir(proc);
+        close(sysfd);
 
         /* nitpic cleanups */
         ps = ps_first;
 
         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;
         if (f) {
                 if (!fgets(cmdline, 255, f))
                         sprintf(cmdline, "Unknown");
+                fclose(f);
         }
 
         /* extract root fs so we can find disk model name in sysfs */
                 if (f) {
                         if (!fgets(model, 255, f))
                                 fprintf(stderr, "Error reading disk model for %s\n", rootbdev);
+                        fclose(f);
                 }
         }
 
                                 break;
                         }
                 }
+                fclose(f);
         }
 
         svg("<text class=\"t1\" x=\"0\" y=\"30\">Bootchart for %s - %s</text>\n",