[dpdk-dev,4/4] eal: fix handling of errno values in IPC

Message ID 540a8617e20f7ae76df7efbf83e24b7109a7579a.1519311106.git.anatoly.burakov@intel.com
State Superseded, archived
Headers show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Burakov, Anatoly Feb. 22, 2018, 3:44 p.m.
Fixes: bacaa2754017 ("eal: add channel for multi-process communication")
Cc: jianfeng.tan@intel.com
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 lib/librte_eal/common/eal_common_proc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Jianfeng Tan Feb. 23, 2018, 3:16 a.m. | #1
> -----Original Message-----
> From: Burakov, Anatoly
> Sent: Thursday, February 22, 2018 11:44 PM
> To: dev@dpdk.org
> Cc: Tan, Jianfeng
> Subject: [PATCH 4/4] eal: fix handling of errno values in IPC
> 
> Fixes: bacaa2754017 ("eal: add channel for multi-process communication")
> Cc: jianfeng.tan@intel.com
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>

Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>

Thanks!

Patch

diff --git a/lib/librte_eal/common/eal_common_proc.c b/lib/librte_eal/common/eal_common_proc.c
index 2dddcaf..3a1088e 100644
--- a/lib/librte_eal/common/eal_common_proc.c
+++ b/lib/librte_eal/common/eal_common_proc.c
@@ -444,13 +444,13 @@  send_msg(const char *dst_path, struct rte_mp_msg *msg, int type)
 	if (snd < 0) {
 		rte_errno = errno;
 		/* Check if it caused by peer process exits */
-		if (errno == -ECONNREFUSED) {
+		if (errno == ECONNREFUSED) {
 			/* We don't unlink the primary's socket here */
 			if (rte_eal_process_type() == RTE_PROC_PRIMARY)
 				unlink_socket_by_path(dst_path);
 			return 0;
 		}
-		if (errno == -ENOBUFS) {
+		if (errno == ENOBUFS) {
 			RTE_LOG(ERR, EAL, "Peer cannot receive message %s\n",
 				dst_path);
 			return 0;