2018-06-24 18:36:21

by Steve Dickson

[permalink] [raw]
Subject: [PATCH] nfsdcltrack: getopt_long() fails on a non x86_64 archs

getopt_long() returns an int, not char, which
matters on non-x86_64 archs since a char is
signed on x86_64 arch but unsigned on other
archs.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1551903

Signed-off-by: Steve Dickson <[email protected]>
---
utils/nfsdcltrack/nfsdcltrack.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/utils/nfsdcltrack/nfsdcltrack.c b/utils/nfsdcltrack/nfsdcltrack.c
index 76b06d2..b45a904 100644
--- a/utils/nfsdcltrack/nfsdcltrack.c
+++ b/utils/nfsdcltrack/nfsdcltrack.c
@@ -553,7 +553,7 @@ find_cmd(char *cmdname)
int
main(int argc, char **argv)
{
- char arg;
+ int arg;
char *val;
int rc = 0;
char *progname, *cmdarg = NULL;
--
2.17.1



2018-06-25 15:36:50

by Steve Dickson

[permalink] [raw]
Subject: Re: [PATCH] nfsdcltrack: getopt_long() fails on a non x86_64 archs



On 06/24/2018 02:36 PM, Steve Dickson wrote:
> getopt_long() returns an int, not char, which
> matters on non-x86_64 archs since a char is
> signed on x86_64 arch but unsigned on other
> archs.
>
> Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1551903
>
> Signed-off-by: Steve Dickson <[email protected]>
Committed...

steved.
> ---
> utils/nfsdcltrack/nfsdcltrack.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/utils/nfsdcltrack/nfsdcltrack.c b/utils/nfsdcltrack/nfsdcltrack.c
> index 76b06d2..b45a904 100644
> --- a/utils/nfsdcltrack/nfsdcltrack.c
> +++ b/utils/nfsdcltrack/nfsdcltrack.c
> @@ -553,7 +553,7 @@ find_cmd(char *cmdname)
> int
> main(int argc, char **argv)
> {
> - char arg;
> + int arg;
> char *val;
> int rc = 0;
> char *progname, *cmdarg = NULL;
>