mirror of
https://github.com/owntone/owntone-server.git
synced 2025-04-18 09:59:53 -04:00
Fix errors introduced by r962 on unix side
This commit is contained in:
parent
201ab40e73
commit
e3fc9fa94c
@ -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;
|
||||||
|
@ -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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user