From: Willem Jan Withagen Date: Wed, 7 Dec 2016 12:58:07 +0000 (+0100) Subject: POSIX/src/common/module.c: do not use strerror_r the GNU way. X-Git-Tag: v12.0.0~330^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e0554f9745e17deb60084d88543c95bb67bf1bff;p=ceph.git POSIX/src/common/module.c: do not use strerror_r the GNU way. From the manpage: char *strerror(int errnum); int strerror_r(int errnum, char *buf, size_t buflen); /* XSI-compliant */ char *strerror_r(int errnum, char *buf, size_t buflen); /* GNU-specific */ So changed the strerror_r() version to a version where we ignore the the result of the function call Signed-off-by: Willem Jan Withagen --- diff --git a/src/common/module.c b/src/common/module.c index cdae181e8269..efe484574ea6 100644 --- a/src/common/module.c +++ b/src/common/module.c @@ -40,8 +40,9 @@ static int run_command(const char *command) if (status < 0) { char error_buf[80]; + strerror_r(errno, error_buf, sizeof(error_buf)); fprintf(stderr, "couldn't run '%s': %s\n", command, - strerror_r(errno, error_buf, sizeof(error_buf))); + error_buf); } else if (WIFSIGNALED(status)) { fprintf(stderr, "'%s' killed by signal %d\n", command, WTERMSIG(status));