From: Dmitry Volyntsev Date: Wed, 6 Nov 2024 23:59:32 +0000 (-0800) Subject: Fixed building by Clang. X-Git-Tag: 0.8.8~11 X-Git-Url: http://www.kaiwu.me/postgresql/commit/static/gitweb.js?a=commitdiff_plain;h=e845d5e553ec6986ec133972544c4c1e171e4f52;p=njs.git Fixed building by Clang. src/qjs.c:347:19: error: variable 'signo' may be uninitialized when used here [-Werror,-Wconditional-uninitialized] 347 | if (kill(pid, signo) < 0) { | ^~~~~ src/qjs.c:294:31: note: initialize the variable 'signo' to silence this warning 294 | int signo, pid; | ^ | = 0 1 error generated. --- diff --git a/src/qjs.c b/src/qjs.c index 44e9fe95..f9615668 100644 --- a/src/qjs.c +++ b/src/qjs.c @@ -301,6 +301,8 @@ qjs_process_kill(JSContext *ctx, JSValueConst this_val, int argc, return JS_EXCEPTION; } + signo = SIGTERM; + if (JS_IsNumber(argv[1])) { if (JS_ToInt32(ctx, &signo, argv[1]) < 0) { return JS_EXCEPTION;