]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
POSIX/src/common/module.c: do not use strerror_r the GNU way. 12363/head
authorWillem Jan Withagen <wjw@digiware.nl>
Wed, 7 Dec 2016 12:58:07 +0000 (13:58 +0100)
committerWillem Jan Withagen <wjw@digiware.nl>
Wed, 7 Dec 2016 19:56:34 +0000 (20:56 +0100)
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 <wjw@digiware.nl>
src/common/module.c

index cdae181e8269a3530e081159a61b641368a36dbc..efe484574ea6fd7f4a20c9306afa363531d841be 100644 (file)
@@ -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));