Displaying 3 results from an estimated 3 matches for "f5c518a".
2016 Mar 07
0
Re: [PATCH v2] Use less stack.
...mum number of characters needed to represent some
integer type, so the size of buf is known at build time:
char buf[sizeof ("/dev/fd/%d") + sizeof(int)*3];
It will be slightly bigger than needed, but still short enough.
> diff --git a/p2v/conversion.c b/p2v/conversion.c
> index f5c518a..8e90ef5 100644
> --- a/p2v/conversion.c
> +++ b/p2v/conversion.c
> @@ -167,7 +167,7 @@ start_conversion (struct config *config,
> int status;
> size_t i, len;
> size_t nr_disks = guestfs_int_count_strings (config->disks);
> - struct data_conn data_conns[nr_disks];...
2016 Mar 07
2
[PATCH v2] Use less stack.
...[1]);
/* Read output from the subprocess and count the length. */
- while ((r = read (fd[0], buffer, sizeof buffer)) > 0) {
+ while ((r = read (fd[0], buffer, BUFSIZ)) > 0) {
*bytes_rtn += r;
}
if (r == -1) {
diff --git a/p2v/conversion.c b/p2v/conversion.c
index f5c518a..8e90ef5 100644
--- a/p2v/conversion.c
+++ b/p2v/conversion.c
@@ -167,7 +167,7 @@ start_conversion (struct config *config,
int status;
size_t i, len;
size_t nr_disks = guestfs_int_count_strings (config->disks);
- struct data_conn data_conns[nr_disks];
+ CLEANUP_FREE struct data_conn *...
2016 Mar 06
8
[PATCH 0/5] Use less stack.
Various changes/fixes to use smaller stack frames.
Rich.