WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

[Xen-API] [PATCH] add an optional environment argument to fork/exec util

To: xen-api@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-API] [PATCH] add an optional environment argument to fork/exec utility fn
From: David Scott <dave.scott@xxxxxxxxxxxxx>
Date: Mon, 21 Dec 2009 21:35:09 +0000
Delivery-date: Mon, 21 Dec 2009 13:29:29 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User David Scott <dave.scott@xxxxxxxxxxxxx>
# Date 1261431271 0
# Node ID 1d0215b3b44d0d29c347ab923b1a3a6d2cbb0bb9
# Parent  891171fa21433a7327e8f517d21d216adc753ead
CA-36084: pass an optional environment to Forkhelpers.execute_command_get_output

Signed-off-by: David Scott <dave.scott@xxxxxxxxxxxxx>

diff -r 891171fa2143 -r 1d0215b3b44d stdext/forkhelpers.ml
--- a/stdext/forkhelpers.ml     Mon Dec 21 18:10:59 2009 +0000
+++ b/stdext/forkhelpers.ml     Mon Dec 21 21:34:31 2009 +0000
@@ -152,10 +152,10 @@
     close_fds
 
 
-let execute_command_get_output cmd args =
+let execute_command_get_output ?env cmd args =
   match with_logfile_fd "execute_command_get_out" (fun out_fd ->
     with_logfile_fd "execute_command_get_err" (fun err_fd ->
-      let (sock,pid) = safe_close_and_exec None (Some out_fd) (Some err_fd) [] 
cmd args in
+      let (sock,pid) = safe_close_and_exec ?env None (Some out_fd) (Some 
err_fd) [] cmd args in
       match Fecomms.read_raw_rpc sock with
        | Fe.Finished x -> Unix.close sock; x
        | _ -> Unix.close sock; failwith "Communications error"     
diff -r 891171fa2143 -r 1d0215b3b44d stdext/forkhelpers.mli
--- a/stdext/forkhelpers.mli    Mon Dec 21 18:10:59 2009 +0000
+++ b/stdext/forkhelpers.mli    Mon Dec 21 21:34:31 2009 +0000
@@ -17,7 +17,7 @@
 (** [execute_command_get_output cmd args] runs [cmd args] and returns (stdout, 
stderr)
        on success (exit 0). On failure this raises 
[Spawn_internal_error(stderr, stdout, Unix.process_status)]
 *)
-val execute_command_get_output : string -> string list -> string * string
+val execute_command_get_output : ?env:string array -> string -> string list -> 
string * string
 
 (** Thrown by [execute_command_get_output] if the subprocess exits with a 
non-zero exit code *)
 exception Spawn_internal_error of string * string * Unix.process_status
2 files changed, 3 insertions(+), 3 deletions(-)
stdext/forkhelpers.ml  |    4 ++--
stdext/forkhelpers.mli |    2 +-


Attachment: xen-api-libs.hg.patch
Description: Text Data

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-API] [PATCH] add an optional environment argument to fork/exec utility fn, David Scott <=