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