mirror of
https://github.com/neovim/neovim.git
synced 2026-04-05 07:09:23 +00:00
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:
@@ -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))) {
|
||||
|
||||
Reference in New Issue
Block a user