From: Dmitry V. Levin Date: Mon, 25 May 2015 20:33:31 +0000 (+0300) Subject: Consistently print OOM diagnostic messages X-Git-Tag: v4.11~510 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=df3899149e57b872af545ec2e83563f5b902d788;p=strace Consistently print OOM diagnostic messages * bjm.c (sys_query_module): Use error_msg to print OOM diagnostics. * util.c (dumpiov, dumpstr): Likewise. --- diff --git a/bjm.c b/bjm.c index 435d6bbf..31720530 100644 --- a/bjm.c +++ b/bjm.c @@ -107,7 +107,7 @@ SYS_FUNC(query_module) size_t idx; if (!data) { - fprintf(stderr, "out of memory\n"); + error_msg("Out of memory"); tprintf(" /* %lu entries */ ", (unsigned long)ret); } else { if (umoven(tcp, tcp->u_arg[2], @@ -134,7 +134,7 @@ SYS_FUNC(query_module) size_t idx; if (!data) { - fprintf(stderr, "out of memory\n"); + error_msg("Out of memory"); tprintf(" /* %lu entries */ ", (unsigned long)ret); } else { if (umoven(tcp, tcp->u_arg[2], diff --git a/util.c b/util.c index 9dad3f1a..63000b57 100644 --- a/util.c +++ b/util.c @@ -828,7 +828,7 @@ dumpiov(struct tcb *tcp, int len, long addr) /* Assuming no sane program has millions of iovs */ if ((unsigned)len > 1024*1024 /* insane or negative size? */ || (iov = malloc(size)) == NULL) { - fprintf(stderr, "Out of memory\n"); + error_msg("Out of memory"); return; } if (umoven(tcp, addr, size, iov) >= 0) { @@ -871,7 +871,7 @@ dumpstr(struct tcb *tcp, long addr, int len) str = malloc(len + 16); if (!str) { strsize = -1; - fprintf(stderr, "Out of memory\n"); + error_msg("Out of memory"); return; } strsize = len + 16;