From: John Kohl Date: Tue, 1 May 1990 17:03:54 +0000 (+0000) Subject: git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@646 dc483132-0cff-0310-8789-dd5450dbe970 X-Git-Tag: krb5-1.0-alpha2~750 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4fb6e76a8ac9b10470870673587cc308e301d2c5;p=krb5.git git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@646 dc483132-0cff-0310-8789-dd5450dbe970 --- 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; }