From d5d0653a602dfe89714e75f3defbcc7b20fabcd4 Mon Sep 17 00:00:00 2001 From: DoHyun Pyun Date: Tue, 28 Jan 2020 15:06:48 +0900 Subject: [PATCH] Fix the build error for execv function error: argument 2 null where non-null expected [-Werror=nonnull] Change-Id: I52334cd5f2fa1655031c1cc1745948e163caba94 Signed-off-by: DoHyun Pyun --- bt-core/bt-core-adapter.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bt-core/bt-core-adapter.c b/bt-core/bt-core-adapter.c index be41307..8481d86 100644 --- a/bt-core/bt-core-adapter.c +++ b/bt-core/bt-core-adapter.c @@ -184,7 +184,12 @@ static int __execute_command(const char *cmd, char *const arg_list[]) if (pid2 == -1) { BT_ERR("fork failed"); } else if (pid2 == 0) { - execv(cmd, arg_list); + if (arg_list != NULL) { + execv(cmd, arg_list); + } else { + char *argv[] = { NULL }; + execv(cmd, argv); + } exit(256); } exit(0); -- 2.7.4