Message ID | 20230428122142.928135-6-fberat@redhat.com |
---|---|
State | New |
Headers | show |
Series | Fix warn unused result | expand |
On 2023-04-28 08:21, Frédéric Bérat wrote: > Fix unused result warnings, detected when _FORTIFY_SOURCE is enabled in > glibc. > --- > sunrpc/netname.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) LGTM. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org> > > diff --git a/sunrpc/netname.c b/sunrpc/netname.c > index dd2cb1b441..d9d82501b0 100644 > --- a/sunrpc/netname.c > +++ b/sunrpc/netname.c > @@ -96,7 +96,8 @@ host2netname (char netname[MAXNETNAMELEN + 1], const char *host, > else > { > domainname[0] = 0; > - getdomainname (domainname, MAXHOSTNAMELEN); > + if (getdomainname (domainname, MAXHOSTNAMELEN)) > + return 0; > } > } > else
diff --git a/sunrpc/netname.c b/sunrpc/netname.c index dd2cb1b441..d9d82501b0 100644 --- a/sunrpc/netname.c +++ b/sunrpc/netname.c @@ -96,7 +96,8 @@ host2netname (char netname[MAXNETNAMELEN + 1], const char *host, else { domainname[0] = 0; - getdomainname (domainname, MAXHOSTNAMELEN); + if (getdomainname (domainname, MAXHOSTNAMELEN)) + return 0; } } else