roland Tollenaar wrote:
> Hi,
> 
> My hardware has arrived. Well some of it, the rest should be coming
> tomorrow. So will be testing the CAN functionality for real if I
> finally get some time to work on this project other than at night. :(
> 
> In the mean time I still wanted to squeeze in applying the patch
> below. However it fails, says something like
> 
> Hunk1 failed at line 295
> Hunk2 succeeded.......
> 
> 1 out of 2 failed.
> 
> This is what I did:
> Put your patch in a file rtdmpatch in the root of the install (not the
> source) directory. Then ran
> patch -p0 < rtdmpatch.
> 
> What am I doing wrong? Running it in the root of the source directory
> won't make a difference will it?
> 

Some mail clients tend to mess with inlined patches. I attached it as
file, applicable against v2.3.x (trunk already contain the fix).

Jan
Index: include/rtdm/rtdm.h
===================================================================
--- include/rtdm/rtdm.h (Revision 2270)
+++ include/rtdm/rtdm.h (Arbeitskopie)
@@ -268,13 +268,22 @@ static inline ssize_t rt_dev_recvfrom(in
                                       struct sockaddr *from,
                                       socklen_t *fromlen)
 {
-    struct iovec    iov = {buf, len};
-    struct msghdr   msg =
-        {from, (from != NULL) ? *fromlen : 0, &iov, 1, NULL, 0};
-    int             ret;
+    struct iovec iov = {
+        .iov_base = buf,
+        .iov_len = len
+    };
+    struct msghdr msg = {
+        .msg_name = from,
+        .msg_namelen = from ? *fromlen : 0,
+        .msg_iov = &iov,
+        .msg_iovlen = 1,
+        .msg_control = NULL,
+        .msg_controllen = 0
+    };
+    int ret;
 
     ret = rt_dev_recvmsg(fd, &msg, flags);
-    if ((ret >= 0) && (from != NULL))
+    if (ret >= 0 && from)
         *fromlen = msg.msg_namelen;
     return ret;
 }
@@ -318,9 +327,18 @@ static inline ssize_t rt_dev_sendto(int 
                                     int flags, const struct sockaddr *to,
                                     socklen_t tolen)
 {
-    struct iovec    iov = {(void *)buf, len};
-    struct msghdr   msg =
-        {(struct sockaddr *)to, tolen, &iov, 1, NULL, 0};
+    struct iovec iov = {
+        .iov_base = (void *)buf,
+        .iov_len = len
+    };
+    struct msghdr msg = {
+        .msg_name = (struct sockaddr *)to,
+        .msg_namelen = tolen,
+        .msg_iov = &iov,
+        .msg_iovlen = 1,
+        .msg_control = NULL, 
+        .msg_controllen = 0
+    };
 
     return rt_dev_sendmsg(fd, &msg, flags);
 }

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

Reply via email to