Skip to content

Commit

Permalink
POSIX/src/common/module.c: do not use strerror_r the GNU way.
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
wjwithagen committed Dec 7, 2016
1 parent b3e2719 commit e0554f9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/common/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit e0554f9

Please sign in to comment.