]> granicus.if.org Git - strace/blobdiff - count.c
tests: do not include <errno.h> unnecessarily
[strace] / count.c
diff --git a/count.c b/count.c
index 25921b25713b1d553f0f08e91a68246a576176ab..4b16ee6606adedbb20583249994bdfffc38976de 100644 (file)
--- a/count.c
+++ b/count.c
@@ -58,11 +58,8 @@ count_syscall(struct tcb *tcp, const struct timeval *syscall_exiting_tv)
        if (!SCNO_IN_RANGE(scno))
                return;
 
-       if (!counts) {
-               counts = calloc(nsyscalls, sizeof(*counts));
-               if (!counts)
-                       die_out_of_memory();
-       }
+       if (!counts)
+               counts = xcalloc(nsyscalls, sizeof(*counts));
        cc = &counts[scno];
 
        cc->calls++;
@@ -143,7 +140,7 @@ set_sortby(const char *sortby)
        else if (strcmp(sortby, "nothing") == 0)
                sortfun = NULL;
        else {
-               error_msg_and_die("invalid sortby: '%s'", sortby);
+               error_msg_and_help("invalid sortby: '%s'", sortby);
        }
 }
 
@@ -171,9 +168,7 @@ call_summary_pers(FILE *outf)
        fprintf(outf, "%6.6s %11.11s %11.11s %9.9s %9.9s %s\n",
                dashes, dashes, dashes, dashes, dashes, dashes);
 
-       sorted_count = calloc(sizeof(int), nsyscalls);
-       if (!sorted_count)
-               die_out_of_memory();
+       sorted_count = xcalloc(sizeof(int), nsyscalls);
        call_cum = error_cum = tv_cum.tv_sec = tv_cum.tv_usec = 0;
        if (overhead.tv_sec == -1) {
                tv_mul(&overhead, &shortest, 8);