All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Xenomai core <xenomai@xenomai.org>
Subject: [Xenomai-core] Bug when closing a busy file descriptor.
Date: Wed, 06 Jun 2007 17:39:36 +0200	[thread overview]
Message-ID: <4666D538.8050004@domain.hid> (raw)

[-- Attachment #1: Type: text/plain, Size: 298 bytes --]


Hi,

there is a bug when closing a busy file descriptor: the close function
keeps incrementing the file descriptor reference count making it
impossible to really close the file descriptor.	

The attached patch fixes this.

-- 
                                                 Gilles Chanteperdrix

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: xeno-unlock-context-when-restarting-rtdm-close.diff --]
[-- Type: text/x-patch; name="xeno-unlock-context-when-restarting-rtdm-close.diff", Size: 683 bytes --]

Index: ksrc/skins/rtdm/core.c
===================================================================
--- ksrc/skins/rtdm/core.c	(révision 2533)
+++ ksrc/skins/rtdm/core.c	(copie de travail)
@@ -340,6 +340,7 @@
     XENO_ASSERT(RTDM, !rthal_local_irq_test(), rthal_local_irq_enable(););
 
     if (unlikely(ret == -EAGAIN) && !rtdm_in_rt_context()) {
+	rtdm_context_unlock(context);
         msleep(CLOSURE_RETRY_PERIOD);
         goto again;
     } else if (unlikely(ret < 0))
@@ -354,6 +355,7 @@
             ret = -EAGAIN;
             goto unlock_out;
         }
+	rtdm_context_unlock(context);
         msleep(CLOSURE_RETRY_PERIOD);
         goto again;
     }

             reply	other threads:[~2007-06-06 15:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-06 15:39 Gilles Chanteperdrix [this message]
2007-06-06 15:54 ` [Xenomai-core] Bug when closing a busy file descriptor Jan Kiszka

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=4666D538.8050004@domain.hid \
    --to=gilles.chanteperdrix@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.