octave-maintainers
[Top][All Lists]
Advanced

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

Re: 2.1.65 snapshot soon?


From: John W. Eaton
Subject: Re: 2.1.65 snapshot soon?
Date: Mon, 14 Feb 2005 13:23:59 -0500

On 11-Feb-2005, Dmitri A. Sergatskov <address@hidden> wrote:

| Dmitri A. Sergatskov wrote:
| ...
| > I just noticed that "ls" on solaris would not work (returns nothing), while
| > system("ls") works fine. I am still investigating and in any case seems 
| > to be a minor problem...
| > 
| 
| I guess it is just the same problem as  
| 
| http://www.octave.org/octave-lists/archive/bug-octave.2004/msg00167.html
| 
| Oh well...

Will you please try the following patch and let me know if it solves
the problem?  I don't seem to have any systems where this fails, but I
know there is a race condition here.  It's just a question of how to
fix that, and I think the previous method was close, but checking for
eof seems to be the wrong thing.  Instead, I think we should check the
"fail" state of the stream, and if that is set, then we should try
reading again if errno is set to EAGAIN.

Thanks,

jwe


src/ChangeLog:

2005-02-14  John W. Eaton  <address@hidden>

        * dirfns.cc (Fls): Check errno if cmd->fail(), not if cmd->eof()
        is false.

 
Index: src/dirfns.cc
===================================================================
RCS file: /usr/local/cvsroot/octave/src/dirfns.cc,v
retrieving revision 1.87
diff -u -r1.87 dirfns.cc
--- src/dirfns.cc       28 Dec 2004 01:59:05 -0000      1.87
+++ src/dirfns.cc       14 Feb 2005 18:12:54 -0000
@@ -188,10 +188,6 @@
 
   if (cmd && *cmd)
     {
-      // This is a bit of a kluge...
-
-      octave_usleep (100);
-
       char ch;
 
       OSSTREAM output_buf;
@@ -205,7 +201,7 @@
            }
          else
            {
-             if (! cmd->eof () && errno == EAGAIN)
+             if (cmd->fail () && errno == EAGAIN)
                {
                  cmd->clear ();
 



reply via email to

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