[v11,3/9] app/test: fix incorrect errno variable

Message ID 1638490007-9939-4-git-send-email-jizh@linux.microsoft.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series app/test: enable subset of tests on Windows |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Jie Zhou Dec. 3, 2021, 12:06 a.m. UTC
  Fix incorrect errno variable used in memory autotest.
Use rte_errno instead.

Fixes: 086d426406bd ("app/test: fix memory autotests on FreeBSD")
Cc: bruce.richardson@intel.com

Signed-off-by: Jie Zhou <jizh@linux.microsoft.com>

---
 app/test/test_memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Dmitry Kozlyuk Dec. 4, 2021, 1:05 a.m. UTC | #1
2021-12-02 16:06 (UTC-0800), Jie Zhou:
> Fix incorrect errno variable used in memory autotest.
> Use rte_errno instead.
> 
> Fixes: 086d426406bd ("app/test: fix memory autotests on FreeBSD")
> Cc: bruce.richardson@intel.com
> 
> Signed-off-by: Jie Zhou <jizh@linux.microsoft.com>

Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>

> ---
>  app/test/test_memory.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/app/test/test_memory.c b/app/test/test_memory.c
> index dbf6871e71..140ac3f3cf 100644
> --- a/app/test/test_memory.c
> +++ b/app/test/test_memory.c
> @@ -63,7 +63,7 @@ check_seg_fds(const struct rte_memseg_list *msl, const struct rte_memseg *ms,
>  	/* we're able to get memseg fd - try getting its offset */
>  	ret = rte_memseg_get_fd_offset_thread_unsafe(ms, &offset);
>  	if (ret < 0) {
> -		if (errno == ENOTSUP)
> +		if (rte_errno == ENOTSUP)
>  			return 1;
>  		return -1;
>  	}
  

Patch

diff --git a/app/test/test_memory.c b/app/test/test_memory.c
index dbf6871e71..140ac3f3cf 100644
--- a/app/test/test_memory.c
+++ b/app/test/test_memory.c
@@ -63,7 +63,7 @@  check_seg_fds(const struct rte_memseg_list *msl, const struct rte_memseg *ms,
 	/* we're able to get memseg fd - try getting its offset */
 	ret = rte_memseg_get_fd_offset_thread_unsafe(ms, &offset);
 	if (ret < 0) {
-		if (errno == ENOTSUP)
+		if (rte_errno == ENOTSUP)
 			return 1;
 		return -1;
 	}