* prof_init.c (profile_init): Fix a problem whereby if the last
authorGeoffrey King <gjking@mit.edu>
Thu, 5 Nov 1998 08:06:53 +0000 (08:06 +0000)
committerGeoffrey King <gjking@mit.edu>
Thu, 5 Nov 1998 08:06:53 +0000 (08:06 +0000)
        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

src/util/profile/ChangeLog
src/util/profile/prof_init.c

index b01a98eba0acdc61b092744837cac0acd7a3dbc0..e3345397c49ef53980bb8e7cc7770c0c1e0495c8 100644 (file)
@@ -1,3 +1,9 @@
+1998-11-05  Geoffrey King  <gjking@mit.edu>
+
+       * 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.
+
 1998-11-03  Theodore Ts'o  <tytso@rsts-11.mit.edu>
 
        * Makefile.in: Added prof_get.c to the list of files to be compiled.
index cbf2bc2ad2de3019701ec5d1aa5a34159099a712..238ee03e8533ce4c6aeb6b4549241bb59d32433d 100644 (file)
@@ -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;