fixup! tests: fix system_spec when run with clipboard manager (#10956)

uv_process_options_t "args" member was set to a local array from stack.
when uv_process_options_t variable is outside the function.
https://pvs-studio.com/en/docs/warnings/v507/
This commit is contained in:
Jan Edmund Lazo
2021-06-05 10:10:09 -04:00
parent 304c6ce934
commit 5571004b69

View File

@@ -6,23 +6,22 @@
#include <uv.h>
uv_loop_t *loop;
uv_process_t child_req;
uv_process_options_t options;
int main(int argc, char **argv)
{
loop = uv_default_loop();
uv_loop_t *loop = uv_default_loop();
uv_process_t child_req;
char * args[3];
args[0] = "sleep";
args[1] = "10";
args[2] = NULL;
options.exit_cb = NULL;
options.file = "sleep";
options.args = args;
options.flags = UV_PROCESS_DETACHED;
uv_process_options_t options = {
.exit_cb = NULL,
.file = "sleep",
.args = args,
.flags = UV_PROCESS_DETACHED,
};
int r;
if ((r = uv_spawn(loop, &child_req, &options))) {