]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common: get rid of "warning: ignoring return value of ‘strerror_r’" 12775/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Wed, 4 Jan 2017 01:54:48 +0000 (09:54 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Wed, 4 Jan 2017 05:55:24 +0000 (13:55 +0800)
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/common/module.c

index efe484574ea6fd7f4a20c9306afa363531d841be..b251274a5f1aa6bbbde42ce0c0f12e6f4cd718cb 100644 (file)
@@ -10,6 +10,7 @@
  *
  */
 
+#include "acconfig.h"
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -40,7 +41,12 @@ 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
                fprintf(stderr, "couldn't run '%s': %s\n", command,
                        error_buf);
        } else if (WIFSIGNALED(status)) {