Skip to content

Commit

Permalink
Fixed building by Clang.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
xeioex committed Nov 7, 2024
1 parent 1a6cc6d commit e845d5e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/qjs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e845d5e

Please sign in to comment.