search for: wsignaled

Displaying 20 results from an estimated 57 matches for "wsignaled".

Did you mean: signaled
2016 Aug 02
0
[PATCH] mllib: check for executable existance in run_command (RHBZ#1362357)
...= true) args = if echo_cmd then debug "%s" (stringify_args args); - let pid = - Unix.create_process (List.hd args) (Array.of_list args) Unix.stdin - Unix.stdout Unix.stderr in - let _, stat = Unix.waitpid [] pid in - match stat with - | Unix.WEXITED i -> i - | Unix.WSIGNALED i -> - error (f_"external command '%s' killed by signal %d") - (stringify_args args) i - | Unix.WSTOPPED i -> - error (f_"external command '%s' stopped by signal %d") - (stringify_args args) i + let app = List.hd args in + try + let ap...
2017 Apr 07
1
[PATCH 1/2] mllib: add new Common_utils.run_commands
...> [] then ( + let matching_pair = List.hd matching_pair in + let idx, _, app, outfd, errfd = matching_pair in + may Unix.close outfd; + may Unix.close errfd; + pids := new_pids; + match stat with + | Unix.WEXITED i -> + res.(idx) <- i + | Unix.WSIGNALED i -> + error (f_"external command ‘%s’ killed by signal %d") + app i + | Unix.WSTOPPED i -> + error (f_"external command ‘%s’ stopped by signal %d") + app i + ); + done; + Array.to_list res + let run_command ?(echo_cmd = true) arg...
2017 Jun 20
2
[PATCH v2 1/2] mllib: add new Common_utils.run_commands
...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 - match stat with - | Unix.WEXITED i -> i - | Unix.WSIGNALED i -> - error (f_"external command ‘%s’ killed by signal %d") - (stringify_args args) i - | Unix.WSTOPPED i -> - error (f_"external command ‘%s’ stopped by signal %d") - (stringify_args args) i + let outfd = get_fd Unix.stdout stdout_chan in +...
2023 Aug 04
1
[libnbd PATCH] golang: Optionally use gofmt on generated .go files
...| Some Gofmt -> + if Config.gofmt <> "no" then ( + let cmd = sprintf "%s -w %s" Config.gofmt filename_new in + match system cmd with + | WEXITED 0 -> () + | WEXITED i -> failwithf "gofmt failed with exit code %d" i + | WSIGNALED i | WSTOPPED i -> + failwithf "gofmt was killed or stopped by signal %d" i + ) | Some Rustfmt -> if Config.rustfmt <> "no" then ( let cmd = sprintf "%s %s" Config.rustfmt filename_new in @@ -439,7 +449,7 @@ let | WEXITE...
2016 Aug 02
2
[PATCH] mllib: move which and its exception from dib
Rename it from "tool" to "executable" in the process, but otherwise it is just code motion (with minimal adjustments in dib). --- dib/dib.ml | 2 +- dib/utils.ml | 16 +--------------- mllib/common_utils.ml | 14 ++++++++++++++ mllib/common_utils.mli | 9 +++++++++ 4 files changed, 25 insertions(+), 16 deletions(-) diff --git a/dib/dib.ml b/dib/dib.ml
2019 Aug 13
5
[PATCH 0/3] generator: pod2text-related improvements
- refactor memoization code - pass pod as stdin rather than files Pino Toscano (3): generator: isolate memoized cache in own module generator: adjust variable names generator: improve pod2text invocation generator/Makefile.am | 3 ++ generator/memoized_cache.ml | 62 +++++++++++++++++++++ generator/memoized_cache.mli | 29 ++++++++++ generator/utils.ml | 101
2019 Jan 16
10
[PATCH 0/5] [RFC] builder: handle unavailable repos
In case a repository of virt-builder references files (e.g. the index) that cannot be downloaded (network issues, 404, etc) then virt-builder errors out on this situation. This is not a nice situation, from an user POV. This series does some refactoring to allow to better handle downloading failures, and handle the failures gracefully in virt-builder. RFC because I'm not yet too convinced
2017 Jun 20
0
[PATCH v2 2/2] dib: use Common_utils.run_commands
...let res = run_commands cmds in + iteri ( + fun i code -> + if code <> 0 then ( + let args, _, _ = List.nth cmds i in error (f_"external command ‘%s’ exited with error %d") - csum_tool i - | Unix.WSIGNALED i -> - error (f_"external command ‘%s’ killed by signal %d") - csum_tool i - | Unix.WSTOPPED i -> - error (f_"external command ‘%s’ stopped by signal %d") - csum_tool i - ); - done; +...
2019 Jan 16
0
[PATCH 1/5] mltools: split helper do_check_exitcode
...run ?(echo_cmd = true) ?stdout_fd ?stderr_fd args = and do_teardown app outfd errfd exitstat = Option.may Unix.close outfd; Option.may Unix.close errfd; - match exitstat with + do_check_exitcode app exitstat + +and do_check_exitcode app = function | Unix.WEXITED i -> i | Unix.WSIGNALED i -> -- 2.20.1
2019 Jan 16
0
[PATCH 2/5] mltools: create a new external_command_code
...and ?(echo_cmd = true) cmd = with End_of_file -> ()); let lines = List.rev !lines in let stat = Unix.close_process_in chan in - (match stat with - | Unix.WEXITED 0 -> () - | Unix.WEXITED i -> - error (f_"external command ‘%s’ exited with error %d") cmd i - | Unix.WSIGNALED i -> - error (f_"external command ‘%s’ killed by signal %d") cmd i - | Unix.WSTOPPED i -> - error (f_"external command ‘%s’ stopped by signal %d") cmd i - ); - lines + let exitcode = do_check_exitcode cmd stat in + lines, exitcode -let rec run_commands ?(echo_...
2019 Aug 13
0
[PATCH 3/3] generator: improve pod2text invocation
...e do lines := input_line chan_out :: !lines done + with End_of_file -> ()); + let lines = List.rev !lines in + (match close_process (chan_out, chan_in) with | WEXITED 0 -> () | WEXITED i -> failwithf "pod2text: process exited with non-zero status (%d)" i | WSIGNALED i | WSTOPPED i -> failwithf "pod2text: process signalled or stopped by signal %d" i ); + let lines = + if discard then (* discard the first line of output *) List.tl lines + else lines in + let lines = + if trim then List.map String.triml lines + else lines in...
2015 Mar 18
0
[PATCH 1/2] mllib: allow external_command to return on nonzero return value
...mething*' when path doesn't exist + * and desired behavior is to get empty list instead of error. + * This is useful for probing partial downloads *) + [] | Unix.WEXITED i -> error ~prog (f_"external command '%s' exited with error %d") cmd i | Unix.WSIGNALED i -> error ~prog (f_"external command '%s' killed by signal %d") cmd i | Unix.WSTOPPED i -> error ~prog (f_"external command '%s' stopped by signal %d") cmd i - ); - lines (* Run uuidgen to return a random UUID. *) let uuidgen ~prog () =...
2019 Jan 16
2
Re: [PATCH 2/5] mltools: create a new external_command_code
...th End_of_file -> ()); > let lines = List.rev !lines in > let stat = Unix.close_process_in chan in > - (match stat with > - | Unix.WEXITED 0 -> () > - | Unix.WEXITED i -> > - error (f_"external command ‘%s’ exited with error %d") cmd i > - | Unix.WSIGNALED i -> > - error (f_"external command ‘%s’ killed by signal %d") cmd i > - | Unix.WSTOPPED i -> > - error (f_"external command ‘%s’ stopped by signal %d") cmd i > - ); > - lines > + let exitcode = do_check_exitcode cmd stat in > + lines, exitc...
2016 Aug 03
0
[PATCH] dib: rework run of extra-data.d hooks (RHBZ#1362354)
...print_string (timing_output ~target_name:hook_name scripts timings) + ); + retcode + in + + g#mount_local mount_dir; + let pid = fork_and_run () in + g#mount_local_run (); + + (match snd (Unix.waitpid [] pid) with + | Unix.WEXITED 0 -> () + | Unix.WEXITED i -> exit i + | Unix.WSIGNALED i + | Unix.WSTOPPED i -> + error (f_"sub-process killed by signal (%d)") i ); + flush_all () let run_install_packages ~debug ~blockdev ~log_file @@ -455,8 +488,6 @@ let main () = do_mkdir auxtmpdir; let hookstmpdir = auxtmpdir // "hooks" in do_mkdir (hoo...
2014 Oct 21
3
Re: [PATCH v5 1/7] tests: Introduce test harness for running tests.
...h_to_absolute path = > + let cmd = sprintf "unset CDPATH; cd %s && pwd" (Filename.quote path) in > + let chan = open_process_in cmd in > + let path = input_line chan in > + (match close_process_in chan with > + | WEXITED 0 -> () > + | WEXITED _ > + | WSIGNALED _ > + | WSTOPPED _ -> > + failwith (sprintf "failed to convert relative path to absolute path: %s" > + cmd) > + ); > + path Interesting, it seems OCaml has nothing in the core libraries to resolve paths, nor realpath implemented in the Unix module.....
2015 Mar 18
5
[PATCH 0/2] [RFE] virt-builder should support download resume
This patchset adds support for resuming downloads in virt-builder. Partially downloaded file is not deleted on exit anymore. There is a check for partially downloaded image in cache directory based on its name. When found, download_to crafts appropriate options to continue its download. Maros Zatko (2): mllib: allow external_command to return [] on nonzero return value builder: support for
2016 Aug 03
3
[PATCH] mllib: move _exit from v2v as Exit module
Move the OCaml binding to C _exit to an own module. Just code motion, adapting v2v in the process. --- docs/C_SOURCE_FILES | 2 +- mllib/Makefile.am | 5 ++++- mllib/exit-c.c | 33 +++++++++++++++++++++++++++++++++ mllib/exit.ml | 19 +++++++++++++++++++ mllib/exit.mli | 20 ++++++++++++++++++++ v2v/Makefile.am | 1 - v2v/changeuid-c.c | 33
2014 Oct 05
0
[PATCH v5 1/7] tests: Introduce test harness for running tests.
...r _ -> false + +let relative_path_to_absolute path = + let cmd = sprintf "unset CDPATH; cd %s && pwd" (Filename.quote path) in + let chan = open_process_in cmd in + let path = input_line chan in + (match close_process_in chan with + | WEXITED 0 -> () + | WEXITED _ + | WSIGNALED _ + | WSTOPPED _ -> + failwith (sprintf "failed to convert relative path to absolute path: %s" + cmd) + ); + path + +let get_lines cmd = + let chan = open_process_in cmd in + let rec loop acc = + try + let line = input_line chan in + loop (line :: ac...
2017 Jul 14
0
[PATCH 02/27] daemon: Allow parts of the daemon and APIs to be written in OCaml.
...(Printexc.to_string exn); + Exit._exit 1 + ); + + (* Parent. *) + close wfd; + + let _, status = waitpid [] pid in + (match status with + | WEXITED 0 -> () + | WEXITED i -> + close rfd; + failwithf "chroot ‘%s’ exited with non-zero error %d" t.name i + | WSIGNALED i -> + close rfd; + failwithf "chroot ‘%s’ killed by signal %d" t.name i + | WSTOPPED i -> + close rfd; + failwithf "chroot ‘%s’ stopped by signal %d" t.name i + ); + + let chan = in_channel_of_descr rfd in + let ret = input_value chan in + close_...
2017 Jul 19
2
Re: [PATCH 02/27] daemon: Allow parts of the daemon and APIs to be written in OCaml.
...lose stderr_fd; > + > + execvp prog argv > + ); > + > + (* Parent process. *) > + close stdin_fd; > + close stdout_fd; > + close stderr_fd; > + let _, status = waitpid [] pid in > + let r = > + match status with > + | WEXITED i -> i > + | WSIGNALED i -> > + failwithf "external command ‘%s’ killed by signal %d" prog i > + | WSTOPPED i -> > + failwithf "external command ‘%s’ stopped by signal %d" prog i in > + > + if verbose () then > + eprintf "command: %s returned %d\n"...