Fix errors introduced by r962 on unix side

This commit is contained in:
Ron Pedde 2006-04-17 04:56:22 +00:00
parent 201ab40e73
commit e3fc9fa94c
2 changed files with 8 additions and 2 deletions

View File

@ -134,7 +134,7 @@ int u_open(u_port_t port) {
* into the buffer. * into the buffer.
* If hostn is NULL or hostnsize <= 0, no hostname is copied. * If hostn is NULL or hostnsize <= 0, no hostname is copied.
*/ */
int u_accept(int fd, char *hostn, strcut in_addr *hostaddr) { int u_accept(int fd, struct in_addr *hostaddr) {
socklen_t len = sizeof(struct sockaddr); socklen_t len = sizeof(struct sockaddr);
struct sockaddr_in netclient; struct sockaddr_in netclient;
int retval; int retval;
@ -143,7 +143,7 @@ int u_accept(int fd, char *hostn, strcut in_addr *hostaddr) {
accept(fd, (struct sockaddr *)(&netclient), &len)) == -1) && accept(fd, (struct sockaddr *)(&netclient), &len)) == -1) &&
(errno == EINTR)) (errno == EINTR))
; ;
if ((retval == -1) || (hostn == NULL) || (hostnsize <= 0)) if (retval == -1)
return retval; return retval;
*hostaddr = netclient.sin_addr; *hostaddr = netclient.sin_addr;

View File

@ -37,6 +37,12 @@
/* Prototypes for the three public UICI functions */ /* Prototypes for the three public UICI functions */
/*********************************************************************/ /*********************************************************************/
#define UPORT #define UPORT
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
typedef unsigned short u_port_t; typedef unsigned short u_port_t;
int u_open(u_port_t port); int u_open(u_port_t port);
int u_accept(int fd, struct in_addr *hostaddr); int u_accept(int fd, struct in_addr *hostaddr);