|
|
@@ -34,23 +34,41 @@ int dfs_net_getsocket(int fd)
|
|
|
|
|
|
static int dfs_net_ioctl(struct dfs_fd* file, int cmd, void* args)
|
|
|
{
|
|
|
+ int ret;
|
|
|
int socket = (int)(size_t)file->fnode->data;
|
|
|
|
|
|
- return sal_ioctlsocket(socket, cmd, args);
|
|
|
+ ret = sal_ioctlsocket(socket, cmd, args);
|
|
|
+ if (ret < 0)
|
|
|
+ {
|
|
|
+ ret = rt_get_errno();
|
|
|
+ }
|
|
|
+ return ret;
|
|
|
}
|
|
|
|
|
|
static int dfs_net_read(struct dfs_fd* file, void *buf, size_t count)
|
|
|
{
|
|
|
+ int ret;
|
|
|
int socket = (int)(size_t)file->fnode->data;
|
|
|
|
|
|
- return sal_recvfrom(socket, buf, count, 0, NULL, NULL);
|
|
|
+ ret = sal_recvfrom(socket, buf, count, 0, NULL, NULL);
|
|
|
+ if (ret < 0)
|
|
|
+ {
|
|
|
+ ret = rt_get_errno();
|
|
|
+ }
|
|
|
+ return ret;
|
|
|
}
|
|
|
|
|
|
static int dfs_net_write(struct dfs_fd *file, const void *buf, size_t count)
|
|
|
{
|
|
|
+ int ret;
|
|
|
int socket = (int)(size_t)file->fnode->data;
|
|
|
|
|
|
- return sal_sendto(socket, buf, count, 0, NULL, 0);
|
|
|
+ ret = sal_sendto(socket, buf, count, 0, NULL, 0);
|
|
|
+ if (ret < 0)
|
|
|
+ {
|
|
|
+ ret = rt_get_errno();
|
|
|
+ }
|
|
|
+ return ret;
|
|
|
}
|
|
|
|
|
|
static int dfs_net_close(struct dfs_fd* file)
|