]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/common/module.c
import 15.2.0 Octopus source
[ceph.git] / ceph / src / common / module.c
index f19f74324c752db7e6164c875c9c022a39fee2e8..e67b3bf933afe5cd718f32395ae49cf4ccb30d32 100644 (file)
@@ -11,6 +11,7 @@
  */
 
 #include "acconfig.h"
+#include "include/compat.h"
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -42,14 +43,9 @@ static int run_command(const char *command)
 
        if (status < 0) {
                char error_buf[80];
-#ifdef STRERROR_R_CHAR_P
-               char* dummy = strerror_r(errno, error_buf, sizeof(error_buf));
-               (void)dummy;
-#else
-               strerror_r(errno, error_buf, sizeof(error_buf));
-#endif
+               char* errp = ceph_strerror_r(errno, error_buf, sizeof(error_buf));
                fprintf(stderr, "couldn't run '%s': %s\n", command,
-                       error_buf);
+                       errp);
        } else if (WIFSIGNALED(status)) {
                fprintf(stderr, "'%s' killed by signal %d\n", command,
                        WTERMSIG(status));