mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-10-17 19:00:08 +08:00
Update to FreeBSD head 2016-08-23
Git mirror commit 9fe7c416e6abb28b1398fd3e5687099846800cfd.
This commit is contained in:
@@ -63,8 +63,7 @@ extern int _rpc_dtablesize( void );
|
||||
static int saw_alarm = 0;
|
||||
|
||||
static void
|
||||
alarm_hndler(s)
|
||||
int s;
|
||||
alarm_hndler(int s)
|
||||
{
|
||||
saw_alarm = 1;
|
||||
return;
|
||||
@@ -85,12 +84,7 @@ alarm_hndler(s)
|
||||
* Turn a 'universal address' into a struct sockaddr_in.
|
||||
* Bletch.
|
||||
*/
|
||||
static int uaddr_to_sockaddr(uaddr, sin)
|
||||
#ifdef foo
|
||||
endpoint *endpt;
|
||||
#endif
|
||||
char *uaddr;
|
||||
struct sockaddr_in *sin;
|
||||
static int uaddr_to_sockaddr(char *uaddr, struct sockaddr_in *sin)
|
||||
{
|
||||
unsigned char p_bytes[2];
|
||||
int i;
|
||||
@@ -120,9 +114,7 @@ static int uaddr_to_sockaddr(uaddr, sin)
|
||||
* Free the strings that were strduped into the eps structure.
|
||||
*/
|
||||
static void
|
||||
free_eps(eps, num)
|
||||
endpoint eps[];
|
||||
int num;
|
||||
free_eps(endpoint eps[], int num)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -144,14 +136,15 @@ free_eps(eps, num)
|
||||
* fact that gethostbyname() could do an NIS search. Ideally, the
|
||||
* NIS+ server will call __rpc_get_time_offset() with the nis_server
|
||||
* structure already populated.
|
||||
*
|
||||
* host - name of the time host
|
||||
* srv - nis_server struct to use.
|
||||
* eps[] - array of endpoints
|
||||
* maxep - max array size
|
||||
*/
|
||||
static nis_server *
|
||||
get_server(sin, host, srv, eps, maxep)
|
||||
struct sockaddr_in *sin;
|
||||
char *host; /* name of the time host */
|
||||
nis_server *srv; /* nis_server struct to use. */
|
||||
endpoint eps[]; /* array of endpoints */
|
||||
int maxep; /* max array size */
|
||||
get_server(struct sockaddr_in *sin, char *host, nis_server *srv,
|
||||
endpoint eps[], int maxep)
|
||||
{
|
||||
char hname[256];
|
||||
int num_ep = 0, i;
|
||||
@@ -238,14 +231,16 @@ get_server(sin, host, srv, eps, maxep)
|
||||
* structure and to then contact the machine for the time.
|
||||
*
|
||||
* td = "server" - "client"
|
||||
*
|
||||
* td - Time difference
|
||||
* srv - NIS Server description
|
||||
* thost - if no server, this is the timehost
|
||||
* uaddr - known universal address
|
||||
* netid - known network identifier
|
||||
*/
|
||||
int
|
||||
__rpc_get_time_offset(td, srv, thost, uaddr, netid)
|
||||
struct timeval *td; /* Time difference */
|
||||
nis_server *srv; /* NIS Server description */
|
||||
char *thost; /* if no server, this is the timehost */
|
||||
char **uaddr; /* known universal address */
|
||||
struct sockaddr_in *netid; /* known network identifier */
|
||||
__rpc_get_time_offset(struct timeval *td, nis_server *srv, char *thost,
|
||||
char **uaddr, struct sockaddr_in *netid)
|
||||
{
|
||||
CLIENT *clnt; /* Client handle */
|
||||
endpoint *ep, /* useful endpoints */
|
||||
@@ -262,7 +257,7 @@ __rpc_get_time_offset(td, srv, thost, uaddr, netid)
|
||||
char ut[64], ipuaddr[64];
|
||||
endpoint teps[32];
|
||||
nis_server tsrv;
|
||||
void (*oldsig)() = NULL; /* old alarm handler */
|
||||
void (*oldsig)(int) = NULL; /* old alarm handler */
|
||||
struct sockaddr_in sin;
|
||||
socklen_t len;
|
||||
int s = RPC_ANYSOCK;
|
||||
@@ -431,7 +426,7 @@ __rpc_get_time_offset(td, srv, thost, uaddr, netid)
|
||||
} else {
|
||||
int res;
|
||||
|
||||
oldsig = (void (*)())signal(SIGALRM, alarm_hndler);
|
||||
oldsig = (void (*)(int))signal(SIGALRM, alarm_hndler);
|
||||
saw_alarm = 0; /* global tracking the alarm */
|
||||
alarm(20); /* only wait 20 seconds */
|
||||
res = _connect(s, (struct sockaddr *)&sin, sizeof(sin));
|
||||
|
Reference in New Issue
Block a user