summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>1999-07-21 21:23:14 +0000
committerKen Raeburn <raeburn@mit.edu>1999-07-21 21:23:14 +0000
commit6f8200ffccae098275442bbef55e7433a7867a78 (patch)
treeeca3c62386afc5cb021dd025dd4392a7aed107ac /src
parent1fdb19d378e26fca9d6e47928c1857312923661e (diff)
* 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. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11571 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r--src/util/profile/ChangeLog7
-rw-r--r--src/util/profile/prof_file.c30
-rw-r--r--src/util/profile/prof_init.c6
-rw-r--r--src/util/profile/prof_int.h2
4 files changed, 25 insertions, 20 deletions
diff --git a/src/util/profile/ChangeLog b/src/util/profile/ChangeLog
index 08bd3ed21..8beb7423a 100644
--- a/src/util/profile/ChangeLog
+++ b/src/util/profile/ChangeLog
@@ -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:
diff --git a/src/util/profile/prof_file.c b/src/util/profile/prof_file.c
index 32ba66d68..e8cbbd95d 100644
--- a/src/util/profile/prof_file.c
+++ b/src/util/profile/prof_file.c
@@ -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;
}
diff --git a/src/util/profile/prof_init.c b/src/util/profile/prof_init.c
index 38192b55f..1f09f412e 100644
--- a/src/util/profile/prof_init.c
+++ b/src/util/profile/prof_init.c
@@ -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);
diff --git a/src/util/profile/prof_int.h b/src/util/profile/prof_int.h
index 90d43d716..970b42e01 100644
--- a/src/util/profile/prof_int.h
+++ b/src/util/profile/prof_int.h
@@ -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
*/