| 1139 | } |
| 1140 | |
| 1141 | rt_err_t lwp_channel_close(int fdt_type, int fd) |
| 1142 | { |
| 1143 | rt_channel_t ch; |
| 1144 | struct dfs_file *d; |
| 1145 | struct dfs_vnode *vnode; |
| 1146 | |
| 1147 | d = lwp_fd_get(fdt_type, fd); |
| 1148 | if (!d) |
| 1149 | { |
| 1150 | return -RT_EIO; |
| 1151 | } |
| 1152 | |
| 1153 | vnode = d->vnode; |
| 1154 | if (!vnode) |
| 1155 | { |
| 1156 | return -RT_EIO; |
| 1157 | } |
| 1158 | |
| 1159 | ch = fd_2_channel(fdt_type, fd); |
| 1160 | if (!ch) |
| 1161 | { |
| 1162 | return -RT_EIO; |
| 1163 | } |
| 1164 | _chfd_free(fd, fdt_type); |
| 1165 | if (vnode->ref_count == 1) |
| 1166 | { |
| 1167 | rt_free(vnode); |
| 1168 | return rt_raw_channel_close(ch); |
| 1169 | } |
| 1170 | |
| 1171 | return 0; |
| 1172 | } |
| 1173 | |
| 1174 | rt_err_t lwp_channel_send(int fdt_type, int fd, rt_channel_msg_t data) |
| 1175 | { |
no test coverage detected