MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / dfs_win32_close

Function dfs_win32_close

bsp/simulator/drivers/dfs_win32.c:242–261  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

240}
241
242static int dfs_win32_close(struct dfs_file *file)
243{
244 if (file->flags & O_DIRECTORY)
245 {
246 WINDIR *wdirp = (WINDIR*)(file->vnode->data);
247 RT_ASSERT(wdirp != RT_NULL);
248 if (_findclose((intptr_t)wdirp->handle) == 0) {
249 free(wdirp->start); /* NOTE: here we don't use rt_free! */
250 rt_free(wdirp);
251 return 0;
252 }
253 }
254 else /* regular file operations */
255 {
256 if (_close((int)(file->data)) == 0)
257 return 0;
258 }
259
260 return win32_result_to_dfs(GetLastError());
261}
262
263static int dfs_win32_ioctl(struct dfs_file *file, int cmd, void *args)
264{

Callers

nothing calls this directly

Calls 4

rt_freeFunction · 0.85
win32_result_to_dfsFunction · 0.85
freeFunction · 0.50
_closeFunction · 0.50

Tested by

no test coverage detected