From e88ab23b5df0851ea3a670b5ead220ea5c05cbe9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?=
 <grubba@grubba.org>
Date: Thu, 13 Nov 2014 12:20:25 +0100
Subject: [PATCH] Process.spawn_pike: Added launcher argument.

---
 lib/modules/Process.pmod | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/lib/modules/Process.pmod b/lib/modules/Process.pmod
index ace8051ecb..bf47ebb380 100644
--- a/lib/modules/Process.pmod
+++ b/lib/modules/Process.pmod
@@ -442,9 +442,18 @@ protected array(string) runpike;
 //!   order to include these components in command path (module path is 
 //!   included by default.)
 //!
+//! @param launcher
+//!   Optional launcher prefix command used to spawn the pike binary.
+//!
+//!   When used this is typically something like
+//!   @expr{({ "/usr/bin/valgrind" })@}.
+//!
+//!   Defaults to the empty array.
+//!
 //! @seealso
 //!   @[Process.Process]
-Process spawn_pike(array(string) argv, void|mapping(string:mixed) options)
+Process spawn_pike(array(string) argv, void|mapping(string:mixed) options,
+		   array(string)|void launcher)
 {
   if (!runpike) {
     array(string) res = ({
@@ -481,7 +490,8 @@ Process spawn_pike(array(string) argv, void|mapping(string:mixed) options)
       res[0] = search_path(res[0]);
     runpike = res;
   }
-  return Process(runpike + argv, options);
+  if (!launcher) launcher = ({});
+  return Process(launcher + runpike + argv, options);
 }
 
 //! Easy and lazy way of using @[Process.Process] that runs a process 
-- 
GitLab