public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Gssd: Avoid compiling warning and simplify codes
@ 2016-07-14  2:44 Kinglong Mee
  2016-07-20 15:13 ` Steve Dickson
  0 siblings, 1 reply; 2+ messages in thread
From: Kinglong Mee @ 2016-07-14  2:44 UTC (permalink / raw)
  To: Steve Dickson; +Cc: linux-nfs, Kinglong Mee

gcc -DHAVE_CONFIG_H -I. -I../../support/include  -I/usr/include/tirpc -D_GNU_SOURCE -Wall -Wextra -Wstrict-prototypes  -pipe -g -O2    -g -O2 -MT gssd-krb5_util.o -MD -MP -MF .deps/gssd-krb5_util.Tpo -c -o gssd-krb5_util.o `test -f 'krb5_util.c' || echo './'`krb5_util.c
krb5_util.c: In function ‘gssd_acquire_user_cred’:
krb5_util.c:1389:4: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
    if (get_verbosity() > 0)
    ^~
krb5_util.c:1392:5: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’
     ret = -1;

Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
---
 utils/gssd/krb5_util.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/utils/gssd/krb5_util.c b/utils/gssd/krb5_util.c
index c1e4d2b..b64818a 100644
--- a/utils/gssd/krb5_util.c
+++ b/utils/gssd/krb5_util.c
@@ -1380,17 +1380,17 @@ gssd_acquire_user_cred(gss_cred_id_t *gss_cred)
 	int ret;
 
 	ret = gssd_acquire_krb5_cred(gss_cred);
+	if (ret)
+		return ret;
 
 	/* force validation of cred to check for expiry */
-	if (ret == 0) {
-		maj_stat = gss_inquire_cred(&min_stat, *gss_cred, 
+	maj_stat = gss_inquire_cred(&min_stat, *gss_cred,
 			NULL, NULL, NULL, NULL);
-		if (maj_stat != GSS_S_COMPLETE) {
-			if (get_verbosity() > 0)
-				pgsserr("gss_inquire_cred",
-					maj_stat, min_stat, &krb5oid);
-				ret = -1;
-			}
+	if (maj_stat != GSS_S_COMPLETE) {
+		if (get_verbosity() > 0)
+			pgsserr("gss_inquire_cred",
+				maj_stat, min_stat, &krb5oid);
+		ret = -1;
 	}
 
 	return ret;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-07-20 15:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-14  2:44 [PATCH] Gssd: Avoid compiling warning and simplify codes Kinglong Mee
2016-07-20 15:13 ` Steve Dickson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox