[dpdk-dev] [PATCH] librte_vhost: Fix the path test issue
Xie, Huawei
huawei.xie at intel.com
Thu Nov 6 03:38:31 CET 2014
> 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.
More information about the dev
mailing list