search for: set_close_on_exec

Displaying 8 results from an estimated 8 matches for "set_close_on_exec".

2017 Apr 07
1
[PATCH 1/2] mllib: add new Common_utils.run_commands
...b/mllib/common_utils.ml @@ -825,29 +825,70 @@ let external_command ?(echo_cmd = true) cmd = ); lines +let run_commands ?(echo_cmd = true) cmds = + let res = Array.make (List.length cmds) 0 in + let get_fd default = function + | None -> + default + | Some fd -> + Unix.set_close_on_exec fd; + fd + in + let pids = + mapi ( + fun i (args, out, err) -> + let app = List.hd args in + try + let app = + if Filename.is_relative app then which app + else (Unix.access app [Unix.X_OK]; app) in + let outfd = get_fd Unix.s...
2017 Jun 20
2
[PATCH v2 1/2] mllib: add new Common_utils.run_commands
...let _, stat = Unix.waitpid [] pid in + do_teardown app outfd errfd stat + | Or code -> + code + +and do_run ?(echo_cmd = true) ?stdout_chan ?stderr_chan args = let app = List.hd args in + let get_fd default = function + | None -> + default + | Some fd -> + Unix.set_close_on_exec fd; + fd + in try let app = if Filename.is_relative app then which app else (Unix.access app [Unix.X_OK]; app) in - let pid = - Unix.create_process app (Array.of_list args) Unix.stdin - Unix.stdout Unix.stderr in - let _, stat = Unix.waitpid [] pid in -...
2017 Jun 20
0
[PATCH v2 2/2] dib: use Common_utils.run_commands
...;) fn; - let pids = + let cmds = List.map ( fun csum -> let csum_fn = fn ^ "." ^ csum in let csum_tool = tool_of_checksum csum in let outfd = Unix.openfile csum_fn file_flags 0o640 in - Unix.set_close_on_exec outfd; - let args = [| csum_tool; fn; |] in - Common_utils.debug "%s" (stringify_args (Array.to_list args)); - let pid = Unix.create_process csum_tool args Unix.stdin - outfd Unix.stderr in - (pid, csum_tool, out...
2017 Aug 01
0
list_add corruption problem
...[<ffffffff811b1461>] ? handle_mm_fault+0x6b1/0x1000 Jul 31 16:58:15 den-nagios kernel: [<ffffffff815ec938>] inet_stream_connect+0x38/0x50 Jul 31 16:58:15 den-nagios kernel: [<ffffffff81555f07>] SYSC_connect+0xe7/0x120 Jul 31 16:58:15 den-nagios kernel: [<ffffffff8121d72d>] ? set_close_on_exec+0x4d/0x70 Jul 31 16:58:15 den-nagios kernel: [<ffffffff81556d0e>] SyS_connect+0xe/0x10 Jul 31 16:58:15 den-nagios kernel: [<ffffffff81697809>] system_call_fastpath+0x16/0x1b Jul 31 16:58:15 den-nagios kernel: ---[ end trace 64494d91939a3eb0 ]--- Thanks, -Chris
2006 Feb 26
2
Help - WEBrick won''t start - "Bad file descriptor" error
...of failure (line 73): /// c:/bin/ruby/lib/ruby/1.8/webrick/utils.rb 70 res.each{|ai| 71 begin 72 logger.debug("TCPServer.new(#{ai[3]}, #{port})") if logger 73 sock = TCPServer.new(ai[3], port) 74 port = sock.addr[1] if port == 0 75 Utils::set_close_on_exec(sock) 76 sockets << sock 77 rescue => ex 78 logger.warn("TCPServer Error: #{ex}") if logger 79 last_error = ex 80 end
2017 Oct 04
11
[PATCH 0/9] build: Require OCaml >= 4.02.
Per my previous email: https://www.redhat.com/archives/libguestfs/2017-September/msg00203.html I'd like to talk about requiring a more modern version of the OCaml compiler. These commits show some of the code changes which would be possible with OCaml >= 3.12 [which it turns out we already require by accident] and also with OCaml >= 4.02. The latter is my favoured option. Rich.
2017 Jul 21
27
[PATCH v2 00/23] Reimplement many daemon APIs in OCaml.
...?chroot parameter, so you don't need to call Sysroot followed by Chroot in two steps. - get_blkid_tag: Add device name to error message as in C equiv. - get_blkid_tag: Use String.chomp instead of String.trimr, since that's closer to what the C code does. - Replace O_CLOEXEC with Unix.set_close_on_exec. We'll need to fix this properly at some point, especially if we make the daemon multithreaded. - Simplify (fun dev -> "/dev/" ^ dev) -> ((^) "/dev/") as suggested. - Factored the functions in daemon/is.ml about as far as is possible. - daemon/parted.ml: Use tr...
2017 Jul 27
23
[PATCH v3 00/23] Reimplement many daemon APIs in OCaml.
I think this fixes everything mentioned: - Added the Optgroups module as suggested. - Remove command temporary files. - Replace command ~flags with ?fold_stdout_on_stderr. - Nest _with_mounted function. - Rebase & retest. Rich.