[Top][All Lists]

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

[Octave-bug-tracker] [bug #56600] system blocks when user calls a backgr

From: Mike Miller
Subject: [Octave-bug-tracker] [bug #56600] system blocks when user calls a background command ending in ampersand
Date: Wed, 10 Jul 2019 15:02:06 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36

Update of bug #56600 (project octave):

                Severity:              3 - Normal => 2 - Minor              
                Priority:              5 - Normal => 3 - Low                
                  Status:               Need Info => Confirmed              
                 Summary: 'system' commnad returns pid for async process, not
on Matlab => system blocks when user calls a background command ending in


Follow-up Comment #7:

I think we should support commands ending with ampersand, and be compatible in
the return values and not block when called with two return values. We are
basically almost compatible, we just need to return an empty string
immediately when the command is backgrounded and the user requests command
output. Maybe there is something simple we can do in octave_procbuf to handle
this correctly?

I see that octave_procbuf already uses

execl (SHELL_PATH, "sh", "-c", command, static_cast<void *> (nullptr));

to run the system command argument when output is requested.

When I run "sh -c 'sleep 10 &'" at a command prompt, it returns immediately.
However, when I try to capture the output with "foo=$(sh -c 'sleep 10 &')", it
blocks. This is basically what's going on in this bug report. We need a way
for that to return immediately if the user is trying to capture command output
but we know the command is backgrounded.


Reply to this item at:


  Message sent via Savannah

reply via email to

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