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

Function fdt_fd_get

components/dfs/dfs_v1/src/dfs.c:343–365  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

341 */
342
343struct dfs_file *fdt_fd_get(struct dfs_fdtable* fdt, int fd)
344{
345 struct dfs_file *d;
346
347 if (fd < 0 || fd >= (int)fdt->maxfd)
348 {
349 return NULL;
350 }
351
352 dfs_file_lock();
353 d = fdt->fds[fd];
354
355 /* check dfs_file valid or not */
356 if ((d == NULL) || (d->magic != DFS_FD_MAGIC))
357 {
358 dfs_file_unlock();
359 return NULL;
360 }
361
362 dfs_file_unlock();
363
364 return d;
365}
366
367struct dfs_file *fd_get(int fd)
368{

Callers 1

fd_getFunction · 0.85

Calls 2

dfs_file_lockFunction · 0.70
dfs_file_unlockFunction · 0.70

Tested by

no test coverage detected