# HG changeset patch # User Rik # Date 1384979336 28800 # Node ID 43c199e83ed7a0e90f29dd3a03b3274cacd84022 # Parent 303157af491fc12d51030e3019296d81b462ef1b 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. diff -r 303157af491f -r 43c199e83ed7 libinterp/corefcn/syscalls.cc --- a/libinterp/corefcn/syscalls.cc Wed Nov 20 11:31:17 2013 -0800 +++ b/libinterp/corefcn/syscalls.cc Wed Nov 20 12:28:56 2013 -0800 @@ -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