search for: wait_command

Displaying 7 results from an estimated 7 matches for "wait_command".

2015 Sep 29
8
[PATCH 0/7] copy-in/copy-out: Capture errors from tar subprocess (RHBZ#1267032).
Commits 3c27f3d91e1566854747bbe844186783fc84f3a8 and 1b6f0daa9ae7fcc94e389232d0c397816cda973d added an internal API for running commands asynchronously. It is only used by the copy-in and copy-out APIs. Unfortunately this made the command code very complex: it was almost impossible to redirect stderr to a file, and there were a lot of long-range dependencies through the file. It was also buggy:
2016 Apr 14
0
[PATCH] Add safe wrapper around waitpid which deals with EINTR correctly.
....c b/src/command.c index 866847d..e2bbf65 100644 --- a/src/command.c +++ b/src/command.c @@ -74,7 +74,6 @@ #include <assert.h> #include <sys/types.h> #include <sys/stat.h> -#include <sys/wait.h> #include <sys/select.h> #ifdef HAVE_SYS_TIME_H @@ -692,10 +691,8 @@ wait_command (struct command *cmd) { int status; - if (waitpid (cmd->pid, &status, 0) == -1) { - perrorf (cmd->g, "waitpid"); + if (guestfs_int_waitpid (cmd->g, cmd->pid, &status, "command") == -1) return -1; - } cmd->pid = 0; @@ -902,7 +899,7 @...
2016 Apr 14
2
[PATCH] Add safe wrapper around waitpid which deals with EINTR correctly.
As Eric Blake noted in: https://www.redhat.com/archives/libguestfs/2016-April/msg00154.html libguestfs doesn't correctly handle the case where waitpid receives a SIGCHLD signal and the main program has registered a non-restartable signal handler. In this case waitpid would return -EINTR and we would print an error, but actually we should retry this case. This adds two new internal functions,
2015 Feb 02
8
[PATCH 0/7 v2] Make copy_in & copy_out APIs, and use copy_in in customize
Hi, attached there is the second version of the patch series adding copy_in and copy_out in the library, mostly moving them from guestfish. It also adds the copy_in usage in virt-customize, as aid in a new image building. Thanks, Pino Toscano (7): cmd: add a way to run (and wait) asynchronously commands cmd: add a child-setup callback cmd: add the possibility to get a fd to the process
2015 Jan 26
6
[PATCH 1/6] cmd: add a way to run (and wait) asynchronously commands
...+618,7 @@ guestfs___cmd_run (struct command *cmd) if (cmd->g->verbose) debug_command (cmd); - if (run_command (cmd) == -1) + if (run_command (cmd, false, false) == -1) return -1; if (loop (cmd) == -1) @@ -624,6 +627,49 @@ guestfs___cmd_run (struct command *cmd) return wait_command (cmd); } +/* Fork, run the command, and returns the pid of the command, + * and its stdout and stderr file descriptors. + * + * Returns the exit status. Test it using WIF* macros. + * + * On error: Calls error(g) and returns -1. + */ +int +guestfs___cmd_run_async (struct command *cmd, pid_t *pi...
2012 Oct 18
10
[PATCH 0/10] Add a mini-library for running external commands.
Inspired by libvirt's virCommand* internal mini-library, this adds some internal APIs for running commands. The first patch contains the new APIs. The subsequent patches change various parts of the library over to use it. Rich.
2015 Feb 14
2
[PATCH 0/2] Change guestfs__*
libguestfs has used double and triple underscores in identifiers. These aren't valid for global names in C++. (http://stackoverflow.com/a/228797) These large but completely mechanical patches change the illegal identifiers to legal ones. Rich.