__alloc_handle changes for dkA r46
space for device specific storage in FILE struct is now allocated in __alloc_handle
This commit is contained in:
parent
50cafaa700
commit
400e85d674
@ -8,7 +8,6 @@ int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen)
|
||||
int ret = 0;
|
||||
int tmp_addrlen = 0x1c;
|
||||
int fd, dev;
|
||||
__handle *handle;
|
||||
u32 *cmdbuf = getThreadCommandBuffer();
|
||||
u8 tmpaddr[0x1c];
|
||||
u32 saved_threadstorage[2];
|
||||
@ -25,15 +24,8 @@ int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen)
|
||||
return -1;
|
||||
}
|
||||
|
||||
fd = __alloc_handle(sizeof(__handle) + sizeof(Handle));
|
||||
if(fd < 0) {
|
||||
errno = ENOMEM;
|
||||
return -1;
|
||||
}
|
||||
|
||||
handle = __get_handle(fd);
|
||||
handle->device = dev;
|
||||
handle->fileStruct = ((void *)handle) + sizeof(__handle);
|
||||
fd = __alloc_handle(dev);
|
||||
if(fd < 0) return fd;
|
||||
|
||||
memset(tmpaddr, 0, 0x1c);
|
||||
|
||||
@ -79,7 +71,10 @@ int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen)
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
__handle *handle = __get_handle(fd);
|
||||
*(Handle*)handle->fileStruct = ret;
|
||||
}
|
||||
|
||||
return fd;
|
||||
}
|
||||
|
@ -37,11 +37,8 @@ int socket(int domain, int type, int protocol)
|
||||
return -1;
|
||||
}
|
||||
|
||||
fd = __alloc_handle(sizeof(__handle) + sizeof(Handle));
|
||||
if(fd < 0) {
|
||||
errno = ENOMEM;
|
||||
return -1;
|
||||
}
|
||||
fd = __alloc_handle(dev);
|
||||
if(fd < 0) return fd;
|
||||
|
||||
handle = __get_handle(fd);
|
||||
handle->device = dev;
|
||||
|
Loading…
Reference in New Issue
Block a user