about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2022-12-12 11:40:54 +0000
committerEric Wong <mwrap-perl@80x24.org>2022-12-12 20:58:42 +0000
commit2c48648ab0c9cfadaa7f68123e84e986f12d2741 (patch)
treec7d0f67bfba708e33f66f4f71bb9ba55a1d1cb30
parent3823974271c178a34af9d35ab8cd6e110a25ecc4 (diff)
downloadmwrap-2c48648ab0c9cfadaa7f68123e84e986f12d2741.tar.gz
FreeBSD, glibc both support it, as do minimalist libcs such as
uClibc and musl.
-rw-r--r--mwrap_core.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/mwrap_core.h b/mwrap_core.h
index 6d498c1..179f136 100644
--- a/mwrap_core.h
+++ b/mwrap_core.h
@@ -826,8 +826,7 @@ static void dump_destructor(void)
                 dump_fd = open(dump_path, O_CLOEXEC|O_WRONLY|O_APPEND|O_CREAT,
                                 0666);
                 if (dump_fd < 0) {
-                        fprintf(stderr, "open %s failed: %s\n", dump_path,
-                                strerror(errno));
+                        fprintf(stderr, "open %s failed: %m\n", dump_path);
                         goto out;
                 }
         }
@@ -850,8 +849,7 @@ static void dump_destructor(void)
                         a.fp = fdopen(dump_fd, modes[i]);
 
                 if (!a.fp) {
-                        fprintf(stderr, "failed to open fd=%d: %s\n",
-                                dump_fd, strerror(errno));
+                        fprintf(stderr, "failed to open fd=%d: %m\n", dump_fd);
                         goto out;
                 }
                 /* we'll leak some memory here, but this is a destructor */
@@ -948,7 +946,7 @@ __attribute__((constructor)) static void mwrap_ctor(void)
                 h->real = h;
                 call_rcu(&h->as.dead, free_hdr_rcu);
         } else
-                fprintf(stderr, "malloc failed: %s\n", strerror(errno));
+                fprintf(stderr, "malloc: %m\n");
 
         h1d_start();
         CHECK(int, 0, pthread_sigmask(SIG_SETMASK, &old, NULL));