search for: close_data

Displaying 4 results from an estimated 4 matches for "close_data".

2020 Feb 26
2
[PATCH] lib: command: switch from select() to poll()
...->outfd >= 0 && FD_ISSET (cmd->outfd, &rset2)) { + if (fds[1].revents & POLLIN) { /* Read the output, buffer it up to the end of the line, then * pass it to the callback. */ @@ -716,18 +725,27 @@ loop (struct command *cmd) cmd->outbuf.close_data (cmd); if (close (cmd->outfd) == -1) perrorf (cmd->g, "close: outfd"); - FD_CLR (cmd->outfd, &rset); + fds[1].fd = -1; cmd->outfd = -1; nr_fds--; } else if (n == -1) { perrorf (cmd->g, "read...
2020 Feb 26
0
Re: [PATCH] lib: command: switch from select() to poll()
...FD_ISSET (cmd->outfd, &rset2)) { > + if (fds[1].revents & POLLIN) { > /* Read the output, buffer it up to the end of the line, then > * pass it to the callback. > */ > @@ -716,18 +725,27 @@ loop (struct command *cmd) > cmd->outbuf.close_data (cmd); > if (close (cmd->outfd) == -1) > perrorf (cmd->g, "close: outfd"); > - FD_CLR (cmd->outfd, &rset); > + fds[1].fd = -1; > cmd->outfd = -1; > nr_fds--; > } > else if (n == -1) {...
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 May 26
0
[PATCH] lib: Limit space and time used by 'qemu-img info' subprocess.
...ait.h> #include <sys/select.h> +#ifdef HAVE_SYS_TIME_H +#include <sys/time.h> +#endif +#ifdef HAVE_SYS_RESOURCE_H +#include <sys/resource.h> +#endif + #include "guestfs.h" #include "guestfs-internal.h" @@ -101,6 +108,12 @@ struct buffering { void (*close_data) (struct command *cmd); }; +struct child_rlimits { + struct child_rlimits *next; + int resource; + long limit; +}; + struct command { guestfs_h *g; @@ -139,6 +152,9 @@ struct command cmd_child_callback child_callback; void *child_callback_data; + /* Optional child limits. */ +...