octave-maintainers
[Top][All Lists]
Advanced

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

Re: New function proposal


From: David Bateman
Subject: Re: New function proposal
Date: Fri, 16 Feb 2007 22:48:44 +0100
User-agent: Thunderbird 1.5.0.7 (X11/20060921)

Michael Goffioul wrote:
> David Bateman a écrit :
>>
>> Ok committed..
>>   
> 
> 2 things about the unit test:
> 1) the 3rd argument to popen2 is not needed for the windows version; as
> long
> as you reset errno and use EINVAL, it should work in non-blocking mode

If I understood correctly, the unit test already resets the errno for
MSVC and so only the third arg needs to be removed from popen2...


> 2) the test result should include \r for the windows version: pipes are
> opened
> in binary mode, without CRLF translation

Is the patch attached what you want?

D.

Index: syscalls.cc
===================================================================
RCS file: /cvs/octave/src/syscalls.cc,v
retrieving revision 1.64
diff -c -r1.64 syscalls.cc
*** syscalls.cc 16 Feb 2007 20:27:46 -0000      1.64
--- syscalls.cc 16 Feb 2007 21:47:30 -0000
***************
*** 355,361 ****
  %!    [in, out, pid] = popen2 ("sort", "-nr");
  %!    EAGAIN = errno ("EAGAIN");
  %!  else
! %!    [in, out, pid] = popen2 ("sort", "/R", 1);
  %!    EAGAIN = errno ("EINVAL");
  %!  endif
  %!  fputs (in, "these\nare\nsome\nstrings\n");
--- 355,361 ----
  %!    [in, out, pid] = popen2 ("sort", "-nr");
  %!    EAGAIN = errno ("EAGAIN");
  %!  else
! %!    [in, out, pid] = popen2 ("sort", "/R");
  %!    EAGAIN = errno ("EINVAL");
  %!  endif
  %!  fputs (in, "these\nare\nsome\nstrings\n");
***************
*** 379,385 ****
  %!     endif
  %!   until (done)
  %!  fclose (out);
! %!  assert(str,{"these\n","strings\n","some\n","are\n"})
  
  */
  
--- 379,389 ----
  %!     endif
  %!   until (done)
  %!  fclose (out);
! %!  if (!isunix())
! %!    assert(str,{"these\n","strings\n","some\n","are\n"})
! %!  else
! %!    assert(str,{"these\r\n","strings\r\n","some\r\n","are\r\n"})
! %!  end
  
  */
  

reply via email to

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