From: John Carr Date: Fri, 25 Sep 1992 03:10:55 +0000 (+0000) Subject: Minor type changes. X-Git-Tag: krb5-1.0-beta2~50 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=dbb85cf259571372405eb56409c1f21d51fb375d;p=krb5.git Minor type changes. Set SO_REUSEADDR. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@2412 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/appl/user_user/server.c b/src/appl/user_user/server.c index af48ca18e..10a17d05f 100644 --- a/src/appl/user_user/server.c +++ b/src/appl/user_user/server.c @@ -69,6 +69,7 @@ char *argv[]; #ifdef DEBUG { + int one = 1; int acc; struct servent *sp; int namelen = sizeof(f_inaddr); @@ -81,11 +82,12 @@ char *argv[]; l_inaddr.sin_family = AF_INET; l_inaddr.sin_addr.s_addr = 0; if (!(sp = getservbyname("uu-sample", "tcp"))) { - com_err("uu-server", 0, "can't find uu-sample/tcp"); + com_err("uu-server", 0, "can't find uu-sample/tcp service"); exit(3); } + (void) setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char *)&one, sizeof (one)); l_inaddr.sin_port = sp->s_port; - if (bind(sock, &l_inaddr, sizeof(l_inaddr))) { + if (bind(sock, (struct sockaddr *)&l_inaddr, sizeof(l_inaddr))) { com_err("uu-server", errno, "binding socket"); exit(3); } @@ -155,7 +157,7 @@ char *argv[]; faddr.contents = (krb5_octet *)&f_inaddr.sin_addr; l = sizeof(l_inaddr); - if (getsockname(0, (caddr_t)&l_inaddr, &l) == -1) + if (getsockname(0, (struct sockaddr *)&l_inaddr, &l) == -1) { com_err("uu-server", errno, "getting local address"); return 6;