Total confusion of what the return values shall be from k_afslog_file

and k_afsklog_all_local_cells.

Changed it to not always return error!


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@686 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Björn Groenvall
1996-08-26 09:35:05 +00:00
parent 076e7d75f2
commit 2afaff02b7

View File

@@ -243,23 +243,21 @@ aix_setup(void)
/*
* Try to find the cells we should try to klog to. Look at
* /usr/vice/etc/TheseCells and /usr/vice/etc/ThisCell,
* in that order.
* Try to find the cells we should try to klog to in "file".
*/
static int
static
int
k_afslog_file(char *file, char *krealm)
{
FILE *f;
char cell[64];
int err = KSUCCESS;
f = fopen(file, "r");
if(f == NULL)
return -1;
while(fgets(cell, sizeof(cell), f) && err == KSUCCESS){
if (f == NULL)
return KSUCCESS; /* No config file is ok! */
while (fgets(cell, sizeof(cell), f) && err == KSUCCESS) {
char *nl = strchr(cell, '\n');
if(nl)
if (nl)
*nl = 0;
err = k_afsklog(cell, krealm);
}
@@ -267,19 +265,20 @@ k_afslog_file(char *file, char *krealm)
return err;
}
static int
k_afsklog_all_local_cells (char *krealm)
static
int
k_afsklog_all_local_cells(char *krealm)
{
int err = KFAILURE;
char *p, home[MaxPathLen];
if((p = getenv("HOME"))){
if ((p = getenv("HOME"))) {
sprintf(home, "%s/.TheseCells", p);
err = err && k_afslog_file(home, krealm);
err = k_afslog_file(home, krealm);
}
k_afslog_file(_PATH_THESECELLS, krealm);
k_afslog_file(_PATH_THISCELL, krealm);
return err;
return KSUCCESS; /* For now. */
}
int