summaryrefslogtreecommitdiffstats
path: root/src/util/profile/prof_init.c
diff options
context:
space:
mode:
authorGeoffrey King <gjking@mit.edu>1998-11-05 08:06:53 +0000
committerGeoffrey King <gjking@mit.edu>1998-11-05 08:06:53 +0000
commit4e1df49c9aeadf2c2f647e456d0ff2261eaaf8b1 (patch)
tree7060424a08ee1a55099d8657bbda44d6c42d4ce7 /src/util/profile/prof_init.c
parentef6187491ccb0f6428c4eca3874c501e4851e8e1 (diff)
downloadkrb5-4e1df49c9aeadf2c2f647e456d0ff2261eaaf8b1.tar.gz
krb5-4e1df49c9aeadf2c2f647e456d0ff2261eaaf8b1.tar.xz
krb5-4e1df49c9aeadf2c2f647e456d0ff2261eaaf8b1.zip
* prof_init.c (profile_init): Fix a problem whereby if the last
pathname in a list of pathnames was nonexistent, an error would be returned that they were all nonexistent. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11015 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/util/profile/prof_init.c')
-rw-r--r--src/util/profile/prof_init.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/util/profile/prof_init.c b/src/util/profile/prof_init.c
index cbf2bc2ad..238ee03e8 100644
--- a/src/util/profile/prof_init.c
+++ b/src/util/profile/prof_init.c
@@ -56,10 +56,13 @@ errcode_t profile_init(filenames, ret_profile)
profile->first_file = new_file;
last = new_file;
}
- /* if the last file was missing, they all were, so report such */
- if (retval == ENOENT) {
+ /*
+ * If last is still null after the loop, then all the files were
+ * missing, so return the appropriate error.
+ */
+ if (!last) {
profile_release(profile);
- return retval;
+ return ENOENT;
}
*ret_profile = profile;
return 0;