+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:
#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;
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;
{
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)
#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);
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 */
}
#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
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;
}
*/
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;
/* 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]);
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);