diff options
| author | Theodore Tso <tytso@mit.edu> | 1995-05-05 04:57:03 +0000 |
|---|---|---|
| committer | Theodore Tso <tytso@mit.edu> | 1995-05-05 04:57:03 +0000 |
| commit | aef0af3adadc2801786e286817628a7ac6801de7 (patch) | |
| tree | 82c86641b3bf8b6c85411ae914b3758e451766b5 /src | |
| parent | 4f899d27fe46faddbb527ca4ab9c40bbc2d16f54 (diff) | |
prof_init.c (profile_get_values): Return PROF_NO_PROFILE if the
passed-in profile variable is NULL (instead of core dumping).
prof_err.et (PROF_NO_PROFILE): Defined new error code.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5727 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
| -rw-r--r-- | src/util/profile/ChangeLog | 7 | ||||
| -rw-r--r-- | src/util/profile/prof_err.et | 1 | ||||
| -rw-r--r-- | src/util/profile/prof_init.c | 3 |
3 files changed, 11 insertions, 0 deletions
diff --git a/src/util/profile/ChangeLog b/src/util/profile/ChangeLog index 3bf2b274f..086c07a26 100644 --- a/src/util/profile/ChangeLog +++ b/src/util/profile/ChangeLog @@ -1,3 +1,10 @@ +Fri May 5 00:02:41 1995 Theodore Y. Ts'o (tytso@dcl) + + * prof_init.c (profile_get_values): Return PROF_NO_PROFILE if the + passed-in profile variable is NULL (instead of core dumping). + + * prof_err.et (PROF_NO_PROFILE): Defined new error code. + Thu May 4 23:57:56 1995 Theodore Y. Ts'o (tytso@dcl) * prof_tree.c (profile_free_node): Copy child->next to a scratch diff --git a/src/util/profile/prof_err.et b/src/util/profile/prof_err.et index 8686829e6..311570a7f 100644 --- a/src/util/profile/prof_err.et +++ b/src/util/profile/prof_err.et @@ -37,5 +37,6 @@ error_code PROF_TOPSECTION_ITER_NOSUPP, error_code PROF_INVALID_SECTION, "Invalid profile_section object" error_code PROF_END_OF_SECTIONS, "No more sections" error_code PROF_BAD_NAMESET, "Bad nameset passed to query routine" +error_code PROF_NO_PROFILE, "No profile file open" end diff --git a/src/util/profile/prof_init.c b/src/util/profile/prof_init.c index 57af950fb..5dcc84e53 100644 --- a/src/util/profile/prof_init.c +++ b/src/util/profile/prof_init.c @@ -126,6 +126,9 @@ errcode_t profile_get_values(profile, names, ret_values) struct string_list values; const char **cpp; + if (profile == 0) + return PROF_NO_PROFILE; + if (names == 0 || names[0] == 0 || names[1] == 0) return PROF_BAD_NAMESET; |
