* prof_int.h (profile_t): Delete typedef, since Miro changed prof_int.h to
authorKen Raeburn <raeburn@mit.edu>
Wed, 21 Jul 1999 21:23:14 +0000 (21:23 +0000)
committerKen Raeburn <raeburn@mit.edu>
Wed, 21 Jul 1999 21:23:14 +0000 (21:23 +0000)
include profile.h, which also has the typedef.
* prof_file.c, prof_init.c: Fix typos and missed variable and type name changes
from Miro's patch.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11571 dc483132-0cff-0310-8789-dd5450dbe970

src/util/profile/ChangeLog
src/util/profile/prof_file.c
src/util/profile/prof_init.c
src/util/profile/prof_int.h

index 08bd3ed21429c6e934e39de8da7212b39aa66da0..8beb7423a684a590cdfa4a769b7ece2939418742 100644 (file)
@@ -1,3 +1,10 @@
+1999-07-21  Ken Raeburn  <raeburn@mit.edu>
+
+       * prof_int.h (profile_t): Delete typedef, since Miro changed
+       prof_int.h to include profile.h, which also has the typedef.
+       * prof_file.c, prof_init.c: Fix typos and missed variable and type
+       name changes from Miro's patch.
+
 1999-07-21 Miro Jurisic   <meeroh@mit.edu>
 
        * profile.hin, prof_file.c, prof_init.c, prof_int.h:
index 32ba66d6846ba9485e49b2865204afc1d70c4ebe..e8cbbd95d0bf32f28b30158771c181e6f299caf5 100644 (file)
@@ -38,10 +38,10 @@ static OSErr GetMacOSTempFilespec (
 #endif
 
 static int rw_access(filespec)
-       profile_filespec_t *filespec;
+       profile_filespec_t filespec;
 {
 #ifdef HAVE_ACCESS
-       if (access(filename, W_OK) == 0)
+       if (access(filespec, W_OK) == 0)
                return 1;
        else
                return 0;
@@ -122,7 +122,7 @@ errcode_t profile_update_file(prf)
        FILE *f;
 
 #ifdef HAVE_STAT
-       if (stat(prf->filename, &st))
+       if (stat(prf->filespec, &st))
                return errno;
        if (st.st_mtime == prf->timestamp)
                return 0;
@@ -192,7 +192,7 @@ errcode_t profile_flush_file(prf)
 {
        FILE            *f;
        profile_filespec_t new_file;
-       profile_filespec_t olf_file;
+       profile_filespec_t old_file;
        errcode_t       retval = 0;
        
        if (!prf || prf->magic != PROF_MAGIC_FILE)
@@ -206,10 +206,10 @@ errcode_t profile_flush_file(prf)
 #ifdef PROFILE_USES_PATHS
        new_file = old_file = 0;
        new_file = malloc(strlen(prf->filespec) + 5);
-       if (!new_name)
+       if (!new_file)
                goto errout;
        old_file = malloc(strlen(prf->filespec) + 5);
-       if (!old_name)
+       if (!old_file)
                goto errout;
 
        sprintf(new_file, "%s.$$$", prf->filespec);
@@ -217,7 +217,7 @@ errcode_t profile_flush_file(prf)
 
        errno = 0;
 
-       f = fopen(new_name, "w");
+       f = fopen(new_file, "w");
 #else
        /* On MacOS, we do this by writing to a new file and then atomically
        swapping the files with a file system call */
@@ -239,14 +239,14 @@ errcode_t profile_flush_file(prf)
        }
 
 #ifdef PROFILE_USES_PATHS
-       unlink(old_name);
-       if (rename(prf->filespec, old_name)) {
+       unlink(old_file);
+       if (rename(prf->filespec, old_file)) {
                retval = errno;
                goto errout;
        }
-       if (rename(new_name, prf->filespec)) {
+       if (rename(new_file, prf->filespec)) {
                retval = errno;
-               rename(old_name, prf->filename); /* back out... */
+               rename(old_file, prf->filespec); /* back out... */
                goto errout;
        }
 #else
@@ -268,10 +268,10 @@ errcode_t profile_flush_file(prf)
        
 errout:
 #ifdef PROFILE_USES_PATHS
-       if (new_name)
-               free(new_name);
-       if (old_name)
-               free(old_name);
+       if (new_file)
+               free(new_file);
+       if (old_file)
+               free(old_file);
 #endif
        return retval;
 }
index 38192b55fb80184d7d51eb8f238093c7ae95d8cd..1f09f412ed1a4fe4c5c8bc58a08923a42baebb7e 100644 (file)
@@ -75,7 +75,7 @@ profile_init(files, ret_profile)
  */
 KRB5_DLLIMP errcode_t KRB5_CALLCONV
 profile_init_path(filepath, ret_profile)
-       profile_filespec_list_t filelist;
+       profile_filespec_list_t filepath;
        profile_t *ret_profile;
 {
        int n_entries, i;
@@ -115,7 +115,7 @@ profile_init_path(filepath, ret_profile)
        /* cap the array */
        filenames[i] = 0;
 
-       retval = profile_init((const char **)filenames, ret_profile);
+       retval = profile_init(filenames, ret_profile);
 
        /* count back down and free the entries */
        while(--i >= 0) free(filenames[i]);
@@ -195,7 +195,7 @@ errcode_t profile_ser_size(unused, profile, sizep)
     for (pfp = profile->first_file; pfp; pfp = pfp->next) {
        required += sizeof(prof_int32);
 #ifdef PROFILE_USES_PATHS
-       if (pfp->filename)
+       if (pfp->filespec)
            required += strlen(pfp->filespec);
 #else
        required += sizeof (profile_filespec_t);
index 90d43d71613ba5d095dcdcbc3c3a22c90d031219..970b42e0186decc05de8a30e17cd00e6c8b7b54d 100644 (file)
@@ -66,8 +66,6 @@ struct _profile_t {
        prf_file_t      first_file;
 };
 
-typedef struct _profile_t *profile_t;
-
 /*
  * Used by the profile iterator in prof_get.c
  */