All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Kisdaroczi <kisda@domain.hid>
To: rpm@xenomai.org
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] rt_task_bind() and timeout values
Date: Tue, 15 Jul 2008 16:28:03 +0200	[thread overview]
Message-ID: <487CB3F3.8060907@domain.hid> (raw)
In-Reply-To: <487BF171.2090902@domain.hid>


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

Hi,

Stefan Kisdaroczi schrieb:
> Hi Philippe,
> 
> the attached patch fixed the problem for me.
> However, i think that in the "break case" still EACCES is returned.
> Can the break be replaced with a "return ETIMEDOUT" ?
> [...]

I have tried it. A new patch is attached. I tested it first without changing
the ">=" to "<=", and the call returned immediately as expected but now with
ETIMEDOUT instead of EACCESS. After changing the ">=" to "<=" it seems to
work like it should.

best regards
kisda

[-- Attachment #1.2: xnregistry_bind_timeout.patch --]
[-- Type: text/plain, Size: 465 bytes --]

--- xenomai/nucleus/registry.c.old	2008-07-15 00:36:10.000000000 +0200
+++ xenomai/nucleus/registry.c	2008-07-15 15:28:23.000000000 +0200
@@ -733,8 +733,10 @@ int xnregistry_bind(const char *key, xnt
 		if (timeout != XN_INFINITE) {
 			xnticks_t now = xntbase_get_time(tbase);
 
-			if (stime + timeout >= now)
-				break;
+			if (stime + timeout <= now) {
+				err = -ETIMEDOUT;
+				goto unlock_and_exit;
+			}		
 
 			timeout -= (now - stime);
 			stime = now;

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]

      parent reply	other threads:[~2008-07-15 14:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-14 17:22 [Xenomai-help] rt_task_bind() and timeout values Stefan Kisdaroczi
2008-07-14 17:50 ` Philippe Gerum
2008-07-14 19:03   ` Stefan Kisdaroczi
2008-07-14 20:35     ` Philippe Gerum
2008-07-15  0:38       ` Stefan Kisdaroczi
2008-07-15  6:25         ` Philippe Gerum
2008-07-16 10:25           ` Stefan Kisdaroczi
2008-07-16 21:17             ` Philippe Gerum
2008-07-17 11:01               ` Stefan Kisdaroczi
2008-07-17 21:58                 ` Philippe Gerum
2008-07-15 14:28         ` Stefan Kisdaroczi [this message]

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=487CB3F3.8060907@domain.hid \
    --to=kisda@domain.hid \
    --cc=rpm@xenomai.org \
    --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.