From: DoHyun Pyun Date: Tue, 28 Jan 2020 06:06:48 +0000 (+0900) Subject: Fix the build error for execv function X-Git-Tag: accepted/tizen/unified/20200129.022658^0 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fconnectivity%2Fbluetooth-frwk.git;a=commitdiff_plain;h=d5d0653a602dfe89714e75f3defbcc7b20fabcd4 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 --- 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);