Fix warnings.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5168 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -10,6 +10,9 @@
|
|||||||
#include <iovec.h>
|
#include <iovec.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#include <net_settings.h>
|
||||||
|
#include <netdb.h>
|
||||||
|
|
||||||
#include <TLS.h>
|
#include <TLS.h>
|
||||||
|
|
||||||
@@ -18,32 +21,37 @@ extern int h_errno;
|
|||||||
// was defined by netdb.h
|
// was defined by netdb.h
|
||||||
static int32 h_errno_tls;
|
static int32 h_errno_tls;
|
||||||
|
|
||||||
|
void initialize_before(void);
|
||||||
|
void terminate_after(void);
|
||||||
|
|
||||||
|
const char * hstrerror(int error);
|
||||||
|
|
||||||
|
int _socket_interrupt(void);
|
||||||
|
int _netconfig_find(void);
|
||||||
|
|
||||||
|
|
||||||
/* These should probably be moved to a seperate file as they
|
/* These should probably be moved to a seperate file as they
|
||||||
* are unique to the library as a whole...
|
* are unique to the library as a whole...
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
void _init()
|
_EXPORT void _init()
|
||||||
{
|
{
|
||||||
h_errno_tls = tls_allocate();
|
h_errno_tls = tls_allocate();
|
||||||
}
|
}
|
||||||
|
|
||||||
void _fini()
|
_EXPORT void _fini()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
void initialize_before()
|
_EXPORT void initialize_before(void)
|
||||||
{
|
{
|
||||||
h_errno_tls = tls_allocate();
|
h_errno_tls = tls_allocate();
|
||||||
}
|
}
|
||||||
|
|
||||||
void terminate_after()
|
_EXPORT void terminate_after(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
struct net_settings {
|
|
||||||
int dummy;
|
|
||||||
};
|
|
||||||
|
|
||||||
_EXPORT int closesocket(int sock)
|
_EXPORT int closesocket(int sock)
|
||||||
{
|
{
|
||||||
return close(sock);
|
return close(sock);
|
||||||
@@ -57,10 +65,9 @@ _EXPORT const char * hstrerror(int error)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
_EXPORT int herror()
|
_EXPORT void herror(const char *error)
|
||||||
{
|
{
|
||||||
printf("herror() not yet supported.");
|
printf("herror() not yet supported.");
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_EXPORT int *_h_errnop()
|
_EXPORT int *_h_errnop()
|
||||||
@@ -69,13 +76,13 @@ _EXPORT int *_h_errnop()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
_EXPORT int _socket_interrupt()
|
_EXPORT int _socket_interrupt(void)
|
||||||
{
|
{
|
||||||
printf("_socket_interrupt\n");
|
printf("_socket_interrupt\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
_EXPORT int _netconfig_find()
|
_EXPORT int _netconfig_find(void)
|
||||||
{
|
{
|
||||||
printf("_netconfig_find\n");
|
printf("_netconfig_find\n");
|
||||||
return 0;
|
return 0;
|
||||||
@@ -86,7 +93,7 @@ _EXPORT int _netconfig_find()
|
|||||||
* will make both R5 and BONE compatible
|
* will make both R5 and BONE compatible
|
||||||
*/
|
*/
|
||||||
|
|
||||||
_EXPORT char * find_net_setting(struct net_settings * ncw, const char * heading, const char * name, char * value, unsigned nbytes)
|
_EXPORT char * find_net_setting(net_settings * ncw, const char * heading, const char * name, char * value, unsigned nbytes)
|
||||||
{
|
{
|
||||||
|
|
||||||
printf("find_net_setting\n");
|
printf("find_net_setting\n");
|
||||||
@@ -107,7 +114,7 @@ _EXPORT char * find_net_setting(struct net_settings * ncw, const char * heading,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
_EXPORT status_t set_net_setting(struct net_settings * ncw, const char * heading, const char * name, const char * value)
|
_EXPORT status_t set_net_setting(net_settings * ncw, const char * heading, const char * name, const char * value)
|
||||||
{
|
{
|
||||||
printf("set_net_setting\n");
|
printf("set_net_setting\n");
|
||||||
return B_UNSUPPORTED;
|
return B_UNSUPPORTED;
|
||||||
@@ -124,7 +131,7 @@ _EXPORT int gethostname(char * name, size_t length)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
_EXPORT int getusername(char * name, uint length)
|
_EXPORT int getusername(char * name, size_t length)
|
||||||
{
|
{
|
||||||
printf("getusername\n");
|
printf("getusername\n");
|
||||||
if (find_net_setting(NULL, "GLOBAL", "USERNAME", name, length) == NULL)
|
if (find_net_setting(NULL, "GLOBAL", "USERNAME", name, length) == NULL)
|
||||||
@@ -134,7 +141,7 @@ _EXPORT int getusername(char * name, uint length)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
_EXPORT int getpassword(char * pwd, uint length)
|
_EXPORT int getpassword(char * pwd, size_t length)
|
||||||
{
|
{
|
||||||
printf("getpassword\n");
|
printf("getpassword\n");
|
||||||
if (find_net_setting(NULL, "GLOBAL", "PASSWORD", pwd, length) == NULL)
|
if (find_net_setting(NULL, "GLOBAL", "PASSWORD", pwd, length) == NULL)
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ int poll(struct pollfd *fds, nfds_t numfds, int timeout)
|
|||||||
fd_set read_set;
|
fd_set read_set;
|
||||||
fd_set write_set;
|
fd_set write_set;
|
||||||
fd_set exception_set;
|
fd_set exception_set;
|
||||||
int i;
|
nfds_t i;
|
||||||
int n;
|
int n;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ int poll(struct pollfd *fds, nfds_t numfds, int timeout)
|
|||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
for(i = 0; i < n; i++) {
|
for(i = 0; i < (nfds_t) n; i++) {
|
||||||
fds[i].revents = 0;
|
fds[i].revents = 0;
|
||||||
|
|
||||||
if (FD_ISSET(fds[i].fd, &read_set)) fds[i].revents |= POLLIN;
|
if (FD_ISSET(fds[i].fd, &read_set)) fds[i].revents |= POLLIN;
|
||||||
|
|||||||
@@ -17,6 +17,9 @@
|
|||||||
|
|
||||||
#include "net_stack_driver.h"
|
#include "net_stack_driver.h"
|
||||||
|
|
||||||
|
// Forward declaration of sysctl.h, because it's currently declared under headers/private/kernel/sysctl.h
|
||||||
|
int sysctl(int *, uint, void *, size_t *, void *, size_t);
|
||||||
|
|
||||||
static bool g_beos_r5_compatibility = false;
|
static bool g_beos_r5_compatibility = false;
|
||||||
|
|
||||||
struct beosr5_sockaddr_in {
|
struct beosr5_sockaddr_in {
|
||||||
@@ -26,11 +29,12 @@ struct beosr5_sockaddr_in {
|
|||||||
char sin_zero[4];
|
char sin_zero[4];
|
||||||
};
|
};
|
||||||
|
|
||||||
static char * get_stack_driver_path();
|
static char * get_stack_driver_path(void);
|
||||||
static void convert_from_beos_r5_sockaddr(struct sockaddr *to, const struct sockaddr *from);
|
static void convert_from_beos_r5_sockaddr(struct sockaddr *to, const struct sockaddr *from);
|
||||||
static void convert_to_beos_r5_sockaddr(struct sockaddr *to, const struct sockaddr *from);
|
static void convert_to_beos_r5_sockaddr(struct sockaddr *to, const struct sockaddr *from);
|
||||||
static void convert_from_beos_r5_sockopt(int *level, int *optnum);
|
static void convert_from_beos_r5_sockopt(int *level, int *optnum);
|
||||||
|
|
||||||
|
|
||||||
_EXPORT int socket(int family, int type, int protocol)
|
_EXPORT int socket(int family, int type, int protocol)
|
||||||
{
|
{
|
||||||
int sock;
|
int sock;
|
||||||
@@ -424,7 +428,7 @@ _EXPORT int sysctl (int *name, uint namelen, void *oldp, size_t *oldlenp,
|
|||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static char * get_stack_driver_path() {
|
static char * get_stack_driver_path(void) {
|
||||||
char * path;
|
char * path;
|
||||||
|
|
||||||
// user-defined stack driver path?
|
// user-defined stack driver path?
|
||||||
|
|||||||
Reference in New Issue
Block a user