rtdmnet.c : Fixed rt/nrt invertion for both sendmsg and recvmsg... m( stable-1.5
authorEdouard Tisserant <edouard.tisserant@gmail.com>
Fri, 05 Oct 2018 23:47:07 +0200
branchstable-1.5
changeset 2722 5e5bec5ee9c1
parent 2721 d3855a6b0a9f
child 2725 e008dc9d8c9f
rtdmnet.c : Fixed rt/nrt invertion for both sendmsg and recvmsg... m(
devices/rtdmnet.c
--- a/devices/rtdmnet.c	Fri Oct 05 18:01:39 2018 +0200
+++ b/devices/rtdmnet.c	Fri Oct 05 23:47:07 2018 +0200
@@ -351,9 +351,9 @@
     msg.msg_iovlen  = 1;
 
 	if (rtdm_in_rt_context())
+        ret = rtdm_sendmsg(dev->socket, &msg, 0);
+	else
         ret = nrt_rtdm_sendmsg(dev->socket, &msg);
-	else
-        ret = rtdm_sendmsg(dev->socket, &msg, 0);
 
     return ret == len ? NETDEV_TX_OK : NETDEV_TX_BUSY;
 }
@@ -407,9 +407,9 @@
         msg.msg_iovlen  = 1;
 
         if (rtdm_in_rt_context())
+            ret = rtdm_recvmsg(dev->socket, &msg, MSG_DONTWAIT);
+        else
             ret = nrt_rtdm_recvmsg(dev->socket, &msg);
-        else
-            ret = rtdm_recvmsg(dev->socket, &msg, MSG_DONTWAIT);
 
         if (ret > 0) {
             ecdev_receive(dev->ecdev, dev->rx_buf, ret);