handle and throwing away any changes that might have been made before
they are flushed to disk.
prof_file.c (profile_close_file): Move functionality of freeing the
profile file to the new function profile_free_file().
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11355
dc483132-0cff-0310-8789-
dd5450dbe970
+1999-04-14 <tytso@rsts-11.mit.edu>
+
+ * prof_init.c (profile_abandon): New function which frees the
+ profile handle and throwing away any changes that might
+ have been made before they are flushed to disk.
+
+ * prof_file.c (profile_close_file): Move functionality of freeing
+ the profile file to the new function profile_free_file().
+
Mon Mar 15 16:03:34 1999 Tom Yu <tlyu@mit.edu>
* profile.hin: Fix GSS_DLLIMP.
}
-errcode_t profile_close_file(prf)
+void profile_free_file(prf)
prf_file_t prf;
{
- errcode_t retval;
-
- retval = profile_flush_file(prf);
- if (retval)
- return retval;
if (prf->filename)
free(prf->filename);
if (prf->root)
prf->magic = 0;
free(prf);
+ return;
+}
+
+errcode_t profile_close_file(prf)
+ prf_file_t prf;
+{
+ errcode_t retval;
+
+ retval = profile_flush_file(prf);
+ if (retval)
+ return retval;
+ profile_free_file(prf);
return 0;
}
return 0;
}
+KRB5_DLLIMP void KRB5_CALLCONV
+profile_abandon(profile)
+ profile_t profile;
+{
+ prf_file_t p, next;
+
+ for (p = profile->first_file; p; p = next) {
+ next = p->next;
+ profile_free_file(p);
+ }
+ profile->magic = 0;
+ free(profile);
+}
KRB5_DLLIMP void KRB5_CALLCONV
profile_release(profile)
errcode_t profile_flush_file
PROTOTYPE ((prf_file_t profile));
+void profile_free_file
+ PROTOTYPE ((prf_file_t profile));
+
errcode_t profile_close_file
PROTOTYPE ((prf_file_t profile));
KRB5_DLLIMP long KRB5_CALLCONV profile_flush
PROTOTYPE ((profile_t profile));
+KRB5_DLLIMP void KRB5_CALLCONV profile_abandon
+ PROTOTYPE ((profile_t profile));
+
KRB5_DLLIMP void KRB5_CALLCONV profile_release
PROTOTYPE ((profile_t profile));