From 955d98c9c1104d469c2989dbfb58f58ee6fe9bdc Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 13 Feb 2014 14:45:51 +0100 Subject: everywhere: make use of new0() and macro() macros, and stop using perror() --- src/bootchart/bootchart.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/bootchart/bootchart.c') diff --git a/src/bootchart/bootchart.c b/src/bootchart/bootchart.c index 27fd505929..630f9c5d15 100644 --- a/src/bootchart/bootchart.c +++ b/src/bootchart/bootchart.c @@ -318,10 +318,10 @@ int main(int argc, char *argv[]) { (void) setrlimit(RLIMIT_NOFILE, &rlim); /* start with empty ps LL */ - ps_first = calloc(1, sizeof(struct ps_struct)); + ps_first = new0(struct ps_struct, 1); if (!ps_first) { - perror("calloc(ps_struct)"); - exit(EXIT_FAILURE); + log_oom(); + return EXIT_FAILURE; } /* handle TERM/INT nicely */ @@ -397,8 +397,8 @@ int main(int argc, char *argv[]) { /* caught signal, probably HUP! */ break; } - perror("nanosleep()"); - exit (EXIT_FAILURE); + log_error("nanosleep() failed: %m"); + exit(EXIT_FAILURE); } } else { overrun++; -- cgit v1.2.3-54-g00ecf