From: John Kohl Date: Fri, 31 Aug 1990 14:59:50 +0000 (+0000) Subject: add error code interpretation X-Git-Tag: krb5-1.0-alpha2~339 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4e5336682e66c2c67e3f6f2ae0c03094985ddacc;p=krb5.git add error code interpretation git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1072 dc483132-0cff-0310-8789-dd5450dbe970 --- 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)) {