search for: err_fd

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

Did you mean: err_fw
2019 Aug 27
2
[PATCH nbdkit] sh: Remove assert and replace with smarter file descriptor duplication. (was: Re: [nbdkit PATCH v2 14/17] sh: Use pipe2 with CLOEXEC when possible)
...d dup2 > + * calls below become more complex to juggle fds around correctly). > + */ > + assert (in_fd[0] > STDERR_FILENO && in_fd[1] > STDERR_FILENO && > + out_fd[0] > STDERR_FILENO && out_fd[1] > STDERR_FILENO && > + err_fd[0] > STDERR_FILENO && err_fd[1] > STDERR_FILENO); This assert is now being thrown whenever we use nbdkit + sh plugin + nbdkit -s option. It's easy to demonstrate using a libnbd one-liner: $ nbdsh -c 'h.connect_command (["nbdkit", "sh", "/tmp/min.s...
2015 Sep 29
2
[PATCH 1/2] copy-in: print tar stderr when it fails
...ar *path, const char **dirname, const char **basename); +static int drain_fd (guestfs_h *g, int fd, char **ret); int guestfs_impl_copy_in (guestfs_h *g, const char *localpath, const char *remotedir) { CLEANUP_CMD_CLOSE struct command *cmd = guestfs_int_new_command (g); - int fd; + int fd, err_fd; int r; char fdbuf[64]; size_t buf_len = strlen (localpath) + 1; char buf[buf_len]; const char *dirname, *basename; + CLEANUP_FREE char *tar_buf = NULL; int remote_is_dir = guestfs_is_dir (g, remotedir); if (remote_is_dir == -1) @@ -67,7 +69,7 @@ guestfs_impl_copy_in (guestf...
2019 Aug 27
0
Re: [PATCH nbdkit] sh: Remove assert and replace with smarter file descriptor duplication. (was: Re: [nbdkit PATCH v2 14/17] sh: Use pipe2 with CLOEXEC when possible)
...* calls below become more complex to juggle fds around correctly). >> + */ >> + assert (in_fd[0] > STDERR_FILENO && in_fd[1] > STDERR_FILENO && >> + out_fd[0] > STDERR_FILENO && out_fd[1] > STDERR_FILENO && >> + err_fd[0] > STDERR_FILENO && err_fd[1] > STDERR_FILENO); > > This assert is now being thrown whenever we use nbdkit + sh plugin + > nbdkit -s option. It's easy to demonstrate using a libnbd one-liner: > > $ nbdsh -c 'h.connect_command (["nbdkit", "s...
2019 Aug 27
1
Re: [PATCH nbdkit] sh: Remove assert and replace with smarter file descriptor duplication. (was: Re: [nbdkit PATCH v2 14/17] sh: Use pipe2 with CLOEXEC when possible)
...come more complex to juggle fds around correctly). >>> + */ >>> + assert (in_fd[0] > STDERR_FILENO && in_fd[1] > STDERR_FILENO && >>> + out_fd[0] > STDERR_FILENO && out_fd[1] > STDERR_FILENO && >>> + err_fd[0] > STDERR_FILENO && err_fd[1] > STDERR_FILENO); >> >> This assert is now being thrown whenever we use nbdkit + sh plugin + >> nbdkit -s option. It's easy to demonstrate using a libnbd one-liner: >> > Hmm, so we've closed stdin/out because the cli...
2019 Aug 02
0
[nbdkit PATCH v2 14/17] sh: Use pipe2 with CLOEXEC when possible
...rbufalloc = ebufalloc = 0; +#ifdef HAVE_PIPE2 + if (pipe2 (in_fd, O_CLOEXEC) == -1) { + nbdkit_error ("%s: pipe2: %m", script); + goto error; + } + if (pipe2 (out_fd, O_CLOEXEC) == -1) { + nbdkit_error ("%s: pipe2: %m", script); + goto error; + } + if (pipe2 (err_fd, O_CLOEXEC) == -1) { + nbdkit_error ("%s: pipe2: %m", script); + goto error; + } +#else + /* Without pipe2, we leave .fork_safe at 0 which forces + * NBDKIT_THREAD_MODEL_SERIALIZE_ALL_REQUESTS, this in turn ensures + * no other thread will be trying to fork, and thus we can sk...
2019 Aug 27
0
[nbdkit PATCH] server: Enforce sane stdin/out/err
...;-s","--exit-with-parent"])' -c 'print("%r"%h.get_size())' 1048576 nbdkit: call.c:155: call3: Assertion `in_fd[0] > STDERR_FILENO && in_fd[1] > STDERR_FILENO && out_fd[0] > STDERR_FILENO && out_fd[1] > STDERR_FILENO && err_fd[0] > STDERR_FILENO && err_fd[1] > STDERR_FILENO' failed. With this patch, the assertion can remain in place. Reported-by: Richard W.M. Jones <rjones@redhat.com> Signed-off-by: Eric Blake <eblake@redhat.com> --- This is my counter-proposal patch which leaves the ass...
2018 Dec 01
1
[nbdkit PATCH] sh: Don't let child inherit SIGPIPE ignored
...+- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/plugins/sh/call.c b/plugins/sh/call.c index 9b3eca8..42923da 100644 --- a/plugins/sh/call.c +++ b/plugins/sh/call.c @@ -121,6 +121,9 @@ call3 (const char *wbuf, size_t wbuflen, /* sent to stdin */ close (out_fd[1]); close (err_fd[1]); + /* Restore SIGPIPE back to SIG_DFL, since shell can't undo SIG_IGN */ + signal (SIGPIPE, SIG_DFL); + /* Set $tmpdir for the script. */ setenv ("tmpdir", tmpdir, 1); diff --git a/tests/test-shell.sh b/tests/test-shell.sh index ef438ec..eabd4fe 100755 --- a/test...
2019 Aug 02
23
[nbdkit PATCH v2 00/17] fd leak safety
This is a major rewrite compared to my v1 series, where I've tried a lot harder to ensure that we still accommodate building on Haiku (although I have not actually yet fired up a Haiku VM to try it for myself). I also managed to make the sh plugin fully parallel, on capable platforms. See also my question on patch 10 on whether I've picked the best naming convention. Eric Blake (17):