From f34af806524310ecfdfdad39eadc5ecb0cf10381 Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Wed, 14 Apr 1999 15:10:43 +0000 Subject: [PATCH] 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(). git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11355 dc483132-0cff-0310-8789-dd5450dbe970 --- src/util/profile/ChangeLog | 9 +++++++++ src/util/profile/prof_file.c | 19 +++++++++++++------ src/util/profile/prof_init.c | 13 +++++++++++++ src/util/profile/prof_int.h | 3 +++ src/util/profile/profile.hin | 3 +++ 5 files changed, 41 insertions(+), 6 deletions(-) diff --git a/src/util/profile/ChangeLog b/src/util/profile/ChangeLog index a9bacd304..4c3056aab 100644 --- a/src/util/profile/ChangeLog +++ b/src/util/profile/ChangeLog @@ -1,3 +1,12 @@ +1999-04-14 + + * 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 * profile.hin: Fix GSS_DLLIMP. diff --git a/src/util/profile/prof_file.c b/src/util/profile/prof_file.c index fe9137afd..0f1ac658f 100644 --- a/src/util/profile/prof_file.c +++ b/src/util/profile/prof_file.c @@ -211,14 +211,9 @@ errout: } -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) @@ -228,6 +223,18 @@ errcode_t profile_close_file(prf) 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; } diff --git a/src/util/profile/prof_init.c b/src/util/profile/prof_init.c index 6a076612f..1411e4f45 100644 --- a/src/util/profile/prof_init.c +++ b/src/util/profile/prof_init.c @@ -132,6 +132,19 @@ profile_flush(profile) 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) diff --git a/src/util/profile/prof_int.h b/src/util/profile/prof_int.h index 312b78e2b..dea4fde84 100644 --- a/src/util/profile/prof_int.h +++ b/src/util/profile/prof_int.h @@ -172,6 +172,9 @@ errcode_t profile_update_file 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)); diff --git a/src/util/profile/profile.hin b/src/util/profile/profile.hin index ee32f90a0..98f7d0215 100644 --- a/src/util/profile/profile.hin +++ b/src/util/profile/profile.hin @@ -45,6 +45,9 @@ KRB5_DLLIMP long KRB5_CALLCONV profile_init_path 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)); -- 2.26.2