MCPcopy Create free account
hub / github.com/F-Stack/f-stack / fsdev_find_sub_dir

Function fsdev_find_sub_dir

dpdk/drivers/crypto/bcmfs/bcmfs_device.c:209–232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

207}
208
209static bool
210fsdev_find_sub_dir(char *path, const char *search, char *output)
211{
212 DIR *dir;
213 struct dirent *entry;
214
215 dir = opendir(path);
216 if (dir == NULL) {
217 BCMFS_LOG(ERR, "Unable to open directory");
218 return -ENODEV;
219 }
220
221 while ((entry = readdir(dir)) != NULL) {
222 if (!strcmp(entry->d_name, search)) {
223 strlcpy(output, entry->d_name, BCMFS_MAX_PATH_LEN);
224 closedir(dir);
225 return true;
226 }
227 }
228
229 closedir(dir);
230
231 return false;
232}
233
234
235static int

Callers 1

bcmfs_vdev_probeFunction · 0.85

Calls 5

opendirFunction · 0.85
readdirFunction · 0.85
strcmpFunction · 0.85
closedirFunction · 0.85
strlcpyFunction · 0.50

Tested by

no test coverage detected