Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
58f15d2b
Commit
58f15d2b
authored
21 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
Added support for -x option to terminate script immediately on local abort
(don't wait for script to self-terminate).
parent
afe11b61
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sbbs3/jsexec.c
+9
-1
9 additions, 1 deletion
src/sbbs3/jsexec.c
with
9 additions
and
1 deletion
src/sbbs3/jsexec.c
+
9
−
1
View file @
58f15d2b
...
...
@@ -60,6 +60,7 @@ char revision[16];
BOOL
pause_on_exit
=
FALSE
;
BOOL
pause_on_error
=
FALSE
;
BOOL
terminated
=
FALSE
;
BOOL
terminate_immediately
=
FALSE
;
void
banner
(
FILE
*
fp
)
{
...
...
@@ -87,6 +88,7 @@ void usage(FILE* fp)
"
\t
-e send error messages to console instead of stderr
\n
"
"
\t
-n send status messages to %s instead of stdout
\n
"
"
\t
-q send console messages to %s instead of stderr
\n
"
"
\t
-x terminate immediately on local abort signal
\n
"
"
\t
-p wait for keypress (pause) on exit
\n
"
"
\t
-! wait for keypress (pause) on error
\n
"
,
JAVASCRIPT_MAX_BYTES
...
...
@@ -403,6 +405,9 @@ js_BranchCallback(JSContext *cx, JSScript *script)
if
(
terminated
)
{
if
(
terminate_immediately
)
return
(
JS_FALSE
);
if
(
JS_GetProperty
(
js_cx
,
js_glob
,
"server"
,
&
val
)
&&
val
!=
JSVAL_VOID
)
obj
=
JSVAL_TO_OBJECT
(
val
);
...
...
@@ -622,7 +627,7 @@ long js_exec(const char *fname, char** args)
void
break_handler
(
int
type
)
{
fprintf
(
stderr
,
"
\n
-> Terminated Locally (%d)
<-
\n
"
,
type
);
fprintf
(
stderr
,
"
\n
-> Terminated Locally (
signal:
%d)
\n
"
,
type
);
terminated
=
TRUE
;
}
...
...
@@ -689,6 +694,9 @@ int main(int argc, char **argv, char** environ)
case
'n'
:
statfp
=
nulfp
;
break
;
case
'x'
:
terminate_immediately
=
TRUE
;
break
;
case
'p'
:
pause_on_exit
=
TRUE
;
break
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment