about summary refs log tree commit homepage
path: root/mwrap_core.h
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-01-13 08:31:23 +0000
committerEric Wong <mwrap-perl@80x24.org>2023-01-13 08:30:27 +0000
commit73d7e6dddf6a12b764d7570f3de50779c24e630b (patch)
tree2ac448e908a0972af0bc8d52dbf5f1d36a185153 /mwrap_core.h
parentbca8045e15c2373196634be46eef4a93029c8417 (diff)
downloadmwrap-73d7e6dddf6a12b764d7570f3de50779c24e630b.tar.gz
perror(3) is standardized and reduces our binary text size a bit:

    text           data     bss     dec     hex filename
   80330           1888    4352   86570   1522a before/Mwrap.so
   80043           1896    4352   86291   15113 after/Mwrap.so
Diffstat (limited to 'mwrap_core.h')
-rw-r--r--mwrap_core.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/mwrap_core.h b/mwrap_core.h
index a246fea..a84cd6d 100644
--- a/mwrap_core.h
+++ b/mwrap_core.h
@@ -742,7 +742,7 @@ char **bt_syms(void * const *addrlist, uint32_t size)
 #else /* make FreeBSD look like glibc output: */
         char **s = backtrace_symbols_fmt(addrlist, size, "%f(%n%D) [%a]");
 #endif
-        if (!s) fprintf(stderr, "backtrace_symbols: %m\n");
+        if (!s) perror("backtrace_symbols");
         return s;
 }
 
@@ -1057,7 +1057,7 @@ __attribute__((constructor)) static void mwrap_ctor(void)
                 h->real = h;
                 call_rcu(&h->as.dead, free_hdr_rcu);
         } else
-                fprintf(stderr, "malloc: %m\n");
+                perror("malloc");
 
         h1d_start();
         CHECK(int, 0, pthread_sigmask(SIG_SETMASK, &old, NULL));