Displaying 10 results from an estimated 10 matches for "command_style_execv".
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.
2017 Oct 06
0
[PATCH v2 1/2] lib: command: If command fails, exit with 126 or 127 as defined by POSIX.
...c void
run_child (struct command *cmd)
{
struct sigaction sa;
- int i, fd, max_fd, r;
+ int i, err, fd, max_fd, r;
char status_string[80];
#ifdef HAVE_SETRLIMIT
struct child_rlimits *child_rlimit;
@@ -614,8 +614,12 @@ run_child (struct command *cmd)
switch (cmd->style) {
case COMMAND_STYLE_EXECV:
execvp (cmd->argv.argv[0], cmd->argv.argv);
+ err = errno;
perror (cmd->argv.argv[0]);
- _exit (EXIT_FAILURE);
+ /* These error codes are defined in POSIX and meant to be the
+ * same as the shell.
+ */
+ _exit (err == ENOENT ? 127 : 126);
case COMMAND_S...
2015 Oct 14
0
[PATCH 2/2] lib: Add comment and regression test for case where main process has large heap.
...y we only use RLIMIT_AS followed by
+ * execvp below, so we get away with it, but adding any code here
+ * could cause a failure.
+ *
+ * There is a regression test for this. See:
+ * tests/regressions/test-big-heap.c
+ */
+
/* Run the command. */
switch (cmd->style) {
case COMMAND_STYLE_EXECV:
diff --git a/tests/regressions/Makefile.am b/tests/regressions/Makefile.am
index 74f23dd..c4f60ae 100644
--- a/tests/regressions/Makefile.am
+++ b/tests/regressions/Makefile.am
@@ -71,6 +71,7 @@ TESTS = \
rhbz1091803.sh \
rhbz1175196.sh \
rhbz1232192.sh \
+ test-big-heap \
test-noexec-stac...
2015 May 26
0
[PATCH] lib: Limit space and time used by 'qemu-img info' subprocess.
...t is
+ * already more restrictive than what we want), so ignore it.
+ */
+ if (errno != EPERM) {
+ perror ("setrlimit");
+ _exit (EXIT_FAILURE);
+ }
+ }
+ }
+#endif /* HAVE_SETRLIMIT */
+
/* Run the command. */
switch (cmd->style) {
case COMMAND_STYLE_EXECV:
diff --git a/src/guestfs-internal.h b/src/guestfs-internal.h
index 414a634..4f06c37 100644
--- a/src/guestfs-internal.h
+++ b/src/guestfs-internal.h
@@ -864,6 +864,7 @@ extern void guestfs_int_cmd_set_stdout_callback (struct command *, cmd_stdout_ca
#define CMD_STDOUT_FLAG_UNBUFFERED 1
#def...
2017 Oct 06
3
[PATCH v2 0/2] lib: Allow db_dump package to be a weak dependency
Previously posted:
https://www.redhat.com/archives/libguestfs/2017-October/msg00032.html
This takes a completely different approach. It turns out that POSIX /
the shell already defines a special exit code 127 for ‘command not
found’. We can make a small adjustment to lib/command.c to return
this exit code in that case.
Then we just have to modify the db_dump code to test for this exit
code.
I
2015 Oct 14
2
[PATCH 1/2] lib: info: Move common code for setting child rlimits.
This is almost just refactoring, but I also set the memory
limit to really 1 GB, and not 1×10⁹.
---
src/info.c | 27 +++++++++++++++------------
1 file changed, 15 insertions(+), 12 deletions(-)
diff --git a/src/info.c b/src/info.c
index d7f45f0..616ef50 100644
--- a/src/info.c
+++ b/src/info.c
@@ -56,6 +56,7 @@ static yajl_val get_json_output (guestfs_h *g, const char *filename);
static char
2013 Aug 24
67
[PATCH 00/67] Proposed patches for libguestfs 1.22.6.
In the kernel and qemu communities it is routine for patches that will
be backported to stable branches to be posted for review. I'm
proposing we do the same for libguestfs stable branches.
All of the attached have been tested with 'make check-release'.
Rich.
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
---
src/command.c | 64 +++++++++++++++++++++++++++++++++++++++++++-------
src/guestfs-internal.h | 3 +++
2 files changed, 58 insertions(+), 9 deletions(-)
diff --git a/src/command.c b/src/command.c
index 4bb469b..e26573d 100644
--- a/src/command.c
+++ b/src/command.c
@@ -360,7 +360,7 @@ debug_command (struct command *cmd)
}
static int
-run_command (struct command *cmd)
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.