git://git.onelab.eu
/
vsys.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3630344
)
Adding some sanity checks for the fd passing module.
author
Sapan Bhatia
<sapanb@cs.princeton.edu>
Thu, 26 Mar 2009 14:46:44 +0000
(14:46 +0000)
committer
Sapan Bhatia
<sapanb@cs.princeton.edu>
Thu, 26 Mar 2009 14:46:44 +0000
(14:46 +0000)
unixsocketwatcher.ml
patch
|
blob
|
history
diff --git
a/unixsocketwatcher.ml
b/unixsocketwatcher.ml
index
420d05a
..
99fe554
100644
(file)
--- a/
unixsocketwatcher.ml
+++ b/
unixsocketwatcher.ml
@@
-13,6
+13,8
@@
open Globals
open Fdwatcher
open Printf
open Fdwatcher
open Printf
+exception Exec_failed
+
let close_if_open fd = (try (ignore(close fd);) with _ -> ())
type control_path_name = string
let close_if_open fd = (try (ignore(close fd);) with _ -> ())
type control_path_name = string
@@
-48,7
+50,9
@@
let receive_event (listening_socket_spec:fname_and_fd) (_:fname_and_fd) =
for i = 3 to 1023 do
if (i != fd) then close_if_open(Obj.magic i)
done;
for i = 3 to 1023 do
if (i != fd) then close_if_open(Obj.magic i)
done;
- execv execpath [|execpath;slice_name;sprintf "%d" fd|] (*with
+ execv execpath [|execpath;slice_name;sprintf "%d" fd|];
+ raise Exec_failed
+ (*with
Unix_error(num,str1,str2)->logprint "Error %d: %s (%s)" (Obj.magic num) str1 str2;raise (Unix_error(num,str1,str2))*)
in
logprint "Could not execve %s" execpath
Unix_error(num,str1,str2)->logprint "Error %d: %s (%s)" (Obj.magic num) str1 str2;raise (Unix_error(num,str1,str2))*)
in
logprint "Could not execve %s" execpath