Bugfix: added missing initialisation.
@@ -771,6 +771,7 @@ int nsa_getpeername(int sockfd, struct sockaddr* name, socklen_t* namelen)
/* ###### NEAT open() implementation ##################################### */
int nsa_open(const char* pathname, int flags, mode_t mode)
{
+ if(nsa_initialize() != NULL) {
const int fd = open(pathname, flags, mode);
if(fd >= 0) {
pthread_mutex_lock(&gSocketAPIInternals->nsi_socket_set_mutex);
@@ -789,6 +790,10 @@ int nsa_open(const char* pathname, int flags, mode_t mode)
pthread_mutex_unlock(&gSocketAPIInternals->nsi_socket_set_mutex);
return(result);
}
+ }
+ else {
+ errno = ENXIO;
+ }
return(-1);
}
@@ -796,6 +801,7 @@ int nsa_open(const char* pathname, int flags, mode_t mode)
/* ###### NEAT creat() implementation #################################### */
int nsa_creat(const char* pathname, mode_t mode)
{
+ if(nsa_initialize() != NULL) {
const int fd = creat(pathname, mode);
if(fd >= 0) {
pthread_mutex_lock(&gSocketAPIInternals->nsi_socket_set_mutex);
@@ -814,6 +820,10 @@ int nsa_creat(const char* pathname, mode_t mode)
pthread_mutex_unlock(&gSocketAPIInternals->nsi_socket_set_mutex);
return(result);
}
+ }
+ else {
+ errno = ENXIO;
+ }
return(-1);
}
