Fix logic in fcc_close(); krb5_fcc_close_file() should be called if
authorTheodore Tso <tytso@mit.edu>
Wed, 6 Jan 1993 00:31:46 +0000 (00:31 +0000)
committerTheodore Tso <tytso@mit.edu>
Wed, 6 Jan 1993 00:31:46 +0000 (00:31 +0000)
a file is open.  Using MAYBE_CLOSE() was just the wrong thing to use.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@2478 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/ccache/file/fcc_close.c

index 35087303c476615c6bbd7e250678fd1136b0a22d..ab1071ee60f11d6b459eec4d1dc571998ae4aa72 100644 (file)
@@ -47,7 +47,8 @@ krb5_fcc_close(id)
 {
      register int closeval = KRB5_OK;
 
-     MAYBE_CLOSE(id, closeval);
+     if (((krb5_fcc_data *) id->data)->fd >= 0)
+            krb5_fcc_close_file(id);
 
      xfree(((krb5_fcc_data *) id->data)->filename);
      xfree(((krb5_fcc_data *) id->data));