Mercurial > hg > octave-nkf
diff libinterp/corefcn/syscalls.cc @ 17968:43c199e83ed7
Reap child process in popen2 %!test block.
* syscalls.cc (popen2): Add waitpid() call in %!test block to reap child.
Add seealso links to popen, waitpid in docstring.
author | Rik <rik@octave.org> |
---|---|
date | Wed, 20 Nov 2013 12:28:56 -0800 |
parents | c02b8bf0e1f9 |
children | c1e4e25872f7 |
line wrap: on
line diff
--- a/libinterp/corefcn/syscalls.cc +++ b/libinterp/corefcn/syscalls.cc @@ -283,9 +283,10 @@ @print{} are\n\ @end example\n\ \n\ -Note that @code{popen2}, unlike @code{popen}, will not @qcode{\"reap\"} the\n\ +Note that @code{popen2}, unlike @code{popen}, will not @nospell{\"reap\"} the\n\ child process. If you don't use @code{waitpid} to check the child's\n\ exit status, it will linger until Octave exits.\n\ +@seealso{popen, waitpid}\n\ @end deftypefn") { octave_value_list retval; @@ -418,6 +419,7 @@ %! endif %! until (done) %! fclose (out); +%! waitpid (pid); %! if (unix_sort) %! assert (str, {"these\n","strings\n","some\n","are\n"}); %! else