diff options
author | Steve Bennett <steveb@workware.net.au> | 2013-07-22 10:29:42 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2013-07-22 10:46:20 +1000 |
commit | c8df8ad4f5fed5a9c85498987e9b416e69fb3b44 (patch) | |
tree | b68919687ad14c7496c009b42c3da28586ff4954 /jim-eventloop.c | |
parent | 5ca6b7ff651246cec3a09a94fda36dc5872fa759 (diff) | |
download | jimtcl-c8df8ad4f5fed5a9c85498987e9b416e69fb3b44.zip jimtcl-c8df8ad4f5fed5a9c85498987e9b416e69fb3b44.tar.gz jimtcl-c8df8ad4f5fed5a9c85498987e9b416e69fb3b44.tar.bz2 |
Ensure that signals can break vwait
The following should break when a handled signal is caught.
catch -signal { vwait forever }
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'jim-eventloop.c')
-rw-r--r-- | jim-eventloop.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/jim-eventloop.c b/jim-eventloop.c index ef62284..ac45eb5 100644 --- a/jim-eventloop.c +++ b/jim-eventloop.c @@ -567,16 +567,19 @@ static int JimELVwaitCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv) Jim_Obj *currValue; currValue = Jim_GetGlobalVariable(interp, argv[1], JIM_NONE); /* Stop the loop if the vwait-ed variable changed value, - * or if was unset and now is set (or the contrary). */ + * or if was unset and now is set (or the contrary) + * or if a signal was caught + */ if ((oldValue && !currValue) || (!oldValue && currValue) || - (oldValue && currValue && !Jim_StringEqObj(oldValue, currValue))) + (oldValue && currValue && !Jim_StringEqObj(oldValue, currValue)) || + Jim_CheckSignal(interp)) { break; + } } if (oldValue) Jim_DecrRefCount(interp, oldValue); - if (rc == -2) { return JIM_ERR; } |