All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: roland Tollenaar <rolandtollenaar@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] warnings and tangled threads.
Date: Thu, 01 Mar 2007 21:27:07 +0100	[thread overview]
Message-ID: <45E7371B.6080406@domain.hid> (raw)
In-Reply-To: <bc4264770703011151r41b38f80m4e1dd3288ba08053@domain.hid>


[-- Attachment #1.1: Type: text/plain, Size: 873 bytes --]

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

[-- Attachment #1.2: rtdm-warning.patch --]
[-- Type: text/plain, Size: 1749 bytes --]

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 #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]

  reply	other threads:[~2007-03-01 20:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-27 23:25 [Xenomai-help] warnings and tangled threads roland Tollenaar
2007-02-28  7:55 ` Jan Kiszka
2007-02-28  8:40   ` Jan Kiszka
2007-02-28 13:53     ` Jan Kiszka
2007-03-01 19:51       ` roland Tollenaar
2007-03-01 20:27         ` Jan Kiszka [this message]
2007-03-01 20:27         ` Dmitry Adamushko
2007-02-28 18:00   ` roland Tollenaar
2007-02-28 20:10     ` Wolfgang Grandegger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45E7371B.6080406@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=rolandtollenaar@domain.hid \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.