From 4fb6e76a8ac9b10470870673587cc308e301d2c5 Mon Sep 17 00:00:00 2001 From: John Kohl Date: Tue, 1 May 1990 17:03:54 +0000 Subject: [PATCH] git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@646 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/ccache/file/fcc_gprin.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/lib/krb5/ccache/file/fcc_gprin.c b/src/lib/krb5/ccache/file/fcc_gprin.c index ef0044ca1..591777042 100644 --- a/src/lib/krb5/ccache/file/fcc_gprin.c +++ b/src/lib/krb5/ccache/file/fcc_gprin.c @@ -38,19 +38,20 @@ krb5_fcc_get_principal(id, princ) krb5_error_code kret; if (OPENCLOSE(id)) { - ((krb5_fcc_data *) id->data)->fd = open(((krb5_fcc_data *) id->data) - ->filename, O_RDONLY, 0); - if (((krb5_fcc_data *) id->data)->fd < 0) + kret = open(((krb5_fcc_data *) id->data)->filename, O_RDONLY, 0); + if (kret < 0) return errno; + ((krb5_fcc_data *) id->data)->fd = kret; } else lseek(((krb5_fcc_data *) id->data)->fd, 0, L_SET); kret = krb5_fcc_read_principal(id, princ); - if (OPENCLOSE(id)) + if (OPENCLOSE(id)) { close(((krb5_fcc_data *) id->data)->fd); - + ((krb5_fcc_data *) id->data)->fd = -1; + } return kret; } -- 2.26.2