> path = realpath(memfile, resolved_path); > - if (path == NULL) { > + if ((path == NULL) && (strlen(resolved_path) == 0)) { > RTE_LOG(ERR, VHOST_CONFIG, > "(%"PRIu64") Failed to resolve fd directory\n", > dev->device_fh); Changchun: For some strange file, according to API description, we shouldn't check resolved_path as it is undefined. To make the loop go on, we could use "continue" when we detect path is NULL.
RETURN VALUE If there is no error, realpath() returns a pointer to the resolved_path. Otherwise it returns a NULL pointer, and the contents of the array resolved_path are undefined, and errno is set to indicate the error.