chiark / gitweb /
doc: disable "make check" for gtk-doc
[elogind.git] / src / bootchart / bootchart.c
index 7bcfd982490f72bd14e9e1782d27860b8889e4ac..f1b0e58c69ba53aebefe5ab878f116adc66c3ab0 100644 (file)
@@ -75,13 +75,11 @@ int main(int argc, char *argv[])
         struct ps_struct *ps;
         char output_file[PATH_MAX];
         char datestr[200];
         struct ps_struct *ps;
         char output_file[PATH_MAX];
         char datestr[200];
-        time_t t;
+        time_t t = 0;
         FILE *f;
         int gind;
         int i;
 
         FILE *f;
         int gind;
         int i;
 
-        memset(&t, 0, sizeof(time_t));
-
         rlim.rlim_cur = 4096;
         rlim.rlim_max = 4096;
         (void) setrlimit(RLIMIT_NOFILE, &rlim);
         rlim.rlim_cur = 4096;
         rlim.rlim_max = 4096;
         (void) setrlimit(RLIMIT_NOFILE, &rlim);
@@ -232,12 +230,11 @@ int main(int argc, char *argv[])
         }
 
         /* start with empty ps LL */
         }
 
         /* start with empty ps LL */
-        ps_first = malloc(sizeof(struct ps_struct));
+        ps_first = calloc(1, sizeof(struct ps_struct));
         if (!ps_first) {
         if (!ps_first) {
-                perror("malloc(ps_struct)");
+                perror("calloc(ps_struct)");
                 exit(EXIT_FAILURE);
         }
                 exit(EXIT_FAILURE);
         }
-        memset(ps_first, 0, sizeof(struct ps_struct));
 
         /* handle TERM/INT nicely */
         memset(&sig, 0, sizeof(struct sigaction));
 
         /* handle TERM/INT nicely */
         memset(&sig, 0, sizeof(struct sigaction));