From 4e5336682e66c2c67e3f6f2ae0c03094985ddacc Mon Sep 17 00:00:00 2001 From: John Kohl Date: Fri, 31 Aug 1990 14:59:50 +0000 Subject: [PATCH] add error code interpretation git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1072 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/ccache/file/fcc_init.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/lib/krb5/ccache/file/fcc_init.c b/src/lib/krb5/ccache/file/fcc_init.c index a422505e1..248ef0620 100644 --- a/src/lib/krb5/ccache/file/fcc_init.c +++ b/src/lib/krb5/ccache/file/fcc_init.c @@ -40,13 +40,18 @@ krb5_fcc_initialize(id, princ) ret = open(((krb5_fcc_data *) id->data)->filename, O_CREAT | O_TRUNC | O_RDWR, 0); if (ret < 0) - return errno; + return krb5_fcc_interpret(errno); ((krb5_fcc_data *) id->data)->fd = ret; ret = fchmod(((krb5_fcc_data *) id->data)->fd, S_IREAD | S_IWRITE); - if (ret == -1) - return ret; - + if (ret == -1) { + ret = krb5_fcc_interpret(errno); + if (OPENCLOSE(id)) { + close(((krb5_fcc_data *)id->data)->fd); + ((krb5_fcc_data *) id->data)->fd = -1; + } + return ret; + } krb5_fcc_store_principal(id, princ); if (OPENCLOSE(id)) { -- 2.26.2