(pop_init): handle krb5_init_context failure consistently

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@9430 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
2000-12-31 07:35:05 +00:00
parent c454153c03
commit bb9b0daf3e

View File

@@ -263,10 +263,16 @@ pop_init(POP *p,int argcount,char **argmessage)
gethostname(p->myhost,MaxHostNameLen);
#ifdef KRB5
krb5_init_context (&p->context);
{
krb5_error_code ret;
krb5_openlog(p->context, p->myname, &p->logf);
krb5_set_warn_dest(p->context, p->logf);
ret = krb5_init_context (&p->context);
if (ret)
errx (1, "krb5_init_context failed: %d", ret);
krb5_openlog(p->context, p->myname, &p->logf);
krb5_set_warn_dest(p->context, p->logf);
}
#else
/* Open the log file */
roken_openlog(p->myname,POP_LOGOPTS,POP_FACILITY);