bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fifo, bogus-fifo, new-fifo


From: Thomas Schwinge
Subject: Re: fifo, bogus-fifo, new-fifo
Date: Wed, 1 Aug 2007 23:36:58 +0200
User-agent: Mutt/1.5.11

Hello!

On Sun, Jul 29, 2007 at 07:40:38PM +0200, Thomas Schwinge wrote:
> What's the story behind `[Hurd]/trans/{,bogus-,new-}fifo.c'?  We're
> currently using `fifo.c', however `new-fifo.c' is also being built and
> installed and can be used, which I did just today (read below).  Where is
> `bogus-fifo.c' stemming from?  Miles, you wrote all three of them.

> $ ./test_fifo_open service/supervise/ok
> open: No such device or address

I propose the following patch to fix this; this is also how things are
done in `new-fifo.c'.

#v+
2007-08-01  Thomas Schwinge  <address@hidden>

        * fifo.c (open_hook): When opening for writing and non-blocking don't
        fail with ENXIO, but succeed.

Index: fifo.c
===================================================================
RCS file: /cvsroot/hurd/hurd/trans/fifo.c,v
retrieving revision 1.24
diff -u -p -r1.24 fifo.c
--- fifo.c      6 Sep 2003 01:10:54 -0000       1.24
+++ fifo.c      1 Aug 2007 21:23:18 -0000
@@ -188,7 +190,7 @@ open_hook (struct trivfs_peropen *po)
        {
          if (wait_for_reader)
            /* Wait until there's a fifo to write to.  */
-           WAIT (active_fifo && active_fifo->readers, ENXIO);
+           WAIT (active_fifo && active_fifo->readers, 0);
          if (!err && active_fifo == NULL)
            /* No other readers, and indeed, no fifo; make one.  */
            {
#v-


> As it was easy to do and I remembered about `/hurd/new-fifo' in just the
> right moment, I did the following:
> 
> #v+
> $ sudo settrans -cp /servers/fifo /hurd/new-fifo --standalone
> [Don't forget the --standalone option ``Don't attempt to use a fifo server''
> to tell this master fifo server to not reconnect to itself recursively...]

I'm not really sure, is this the correct way to do this?  Wasn't perhaps
the ``--server'' option ``Operate in server mode'' meant to be used here
instead?  However, if I use that one instead, things in fifo land don't
work at all anymore.  But as I'm not yet convinced that a system wide
fifo-server would be really better (what would ``better'' actually mean
in this case?) I decided to not concentrate on that one any further, but
will instead try to get `fifo.c' working as expected.


> What are other programs that depend on fifos or does someone even know of
> a fifo test suite?

Any ideas?


Regards,
 Thomas

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]