changeset 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 303157af491f
children c1e4e25872f7
files libinterp/corefcn/syscalls.cc
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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