Call krb5_warnx instead of fprintf. Now takes port in host byte order.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@3303 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -41,17 +41,17 @@
|
|||||||
RCSID("$Id$");
|
RCSID("$Id$");
|
||||||
|
|
||||||
int
|
int
|
||||||
krb5_getportbyname (const char *service,
|
krb5_getportbyname (krb5_context context,
|
||||||
|
const char *service,
|
||||||
const char *proto,
|
const char *proto,
|
||||||
int default_port)
|
int default_port)
|
||||||
{
|
{
|
||||||
struct servent *sp;
|
struct servent *sp;
|
||||||
|
|
||||||
if ((sp = getservbyname (service, proto)) == NULL) {
|
if ((sp = getservbyname (service, proto)) == NULL) {
|
||||||
fprintf (stderr, "%s/%s unknown service, "
|
krb5_warnx(context, "%s/%s unknown service, using default port %d",
|
||||||
"using default port %d\n", service, proto,
|
service, proto, default_port);
|
||||||
ntohs(default_port));
|
return htons(default_port);
|
||||||
return default_port;
|
|
||||||
} else
|
} else
|
||||||
return sp->s_port;
|
return sp->s_port;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user