X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fbootchart%2Fbootchart.c;h=f1b0e58c69ba53aebefe5ab878f116adc66c3ab0;hp=7bcfd982490f72bd14e9e1782d27860b8889e4ac;hb=9795da43c4b70fea1eef798d4aeb0467d6fb5f68;hpb=53f5329f7aa321d72847cd7f8f28da9a7db80331 diff --git a/src/bootchart/bootchart.c b/src/bootchart/bootchart.c index 7bcfd9824..f1b0e58c6 100644 --- a/src/bootchart/bootchart.c +++ b/src/bootchart/bootchart.c @@ -75,13 +75,11 @@ int main(int argc, char *argv[]) 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; - memset(&t, 0, sizeof(time_t)); - 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 */ - ps_first = malloc(sizeof(struct ps_struct)); + ps_first = calloc(1, sizeof(struct ps_struct)); if (!ps_first) { - perror("malloc(ps_struct)"); + perror("calloc(ps_struct)"); exit(EXIT_FAILURE); } - memset(ps_first, 0, sizeof(struct ps_struct)); /* handle TERM/INT nicely */ memset(&sig, 0, sizeof(struct sigaction));