]> xenbits.xensource.com Git - xcp/xen-api.git/commitdiff
CA-47759 - CLI command vm-reboot failed: Stunnel process 17840 existed with exit...
authorJohn Else <john.else@citrix.com>
Wed, 26 Jan 2011 17:39:05 +0000 (17:39 +0000)
committerJohn Else <john.else@citrix.com>
Wed, 26 Jan 2011 17:39:05 +0000 (17:39 +0000)
Remove the really_write function and instead use Unixext.really_write.

Signed-off-by: John Else <john.else@citrix.com>
ocaml/xapi/cli_protocol.ml
ocaml/xe-cli/newcli.ml

index 527d3988329d84ce9bef68705866808cd6faf756..fefd4e3a6d9a07cd2907c6c4ca97f8e28407bedd 100644 (file)
@@ -199,11 +199,8 @@ let marshal_message = function
   | Response x -> marshal_int 10 ^ (marshal_response x)
   | Blob x     -> marshal_int 11 ^ (marshal_blob_header x) 
 
-let really_write (fd: Unix.file_descr) buf ofs len = 
-  if Unix.write fd buf ofs len <> len then raise End_of_file
-
 let write_string (fd: Unix.file_descr) buf = 
-  really_write fd buf 0 (String.length buf)
+  Unixext.really_write fd buf 0 (String.length buf)
 
 (** Marshal a message to a file descriptor prefixing it with total header length *)
 let marshal (fd: Unix.file_descr) x = 
index a0c4726de06824d5176fd4be2108a1f00c66de65..d668edc4ea26a45075d03dbbad7d1984aae8f2fc 100644 (file)
@@ -312,7 +312,7 @@ let main_loop ifd ofd =
             let left = ref length in
             while !left > 0 do
               let n = Unix.read fd buffer 0 (min (String.length buffer) !left) in
-              really_write ofd buffer 0 n;
+              Unixext.really_write ofd buffer 0 n;
               left := !left - n
             done;
             marshal ofd (Blob End);
@@ -396,7 +396,7 @@ let main_loop ifd ofd =
                   while not(!finished) do
                     let num = input ic buffer 0 (String.length buffer) in
                     begin try
-                      really_write fd buffer 0 num;
+                      Unixext.really_write fd buffer 0 num;
                     with
                       Unix.Unix_error (a,b,c) ->
                         raise (ClientSideError (Printf.sprintf "%s: %s, %s." (Unix.error_message a) b c))