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
d40a3001
Commit
d40a3001
authored
20 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
If run with -l (loop) option on unix, a SIGHUP will cause a recycle/re-run.
parent
a854287e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sbbs3/jsexec.c
+17
-3
17 additions, 3 deletions
src/sbbs3/jsexec.c
with
17 additions
and
3 deletions
src/sbbs3/jsexec.c
+
17
−
3
View file @
d40a3001
...
...
@@ -65,6 +65,7 @@ char host_name_buf[128];
BOOL
pause_on_exit
=
FALSE
;
BOOL
pause_on_error
=
FALSE
;
BOOL
terminated
=
FALSE
;
BOOL
recycled
=
FALSE
;
DWORD
log_mask
=
DEFAULT_LOG_MASK
;
int
err_level
=
DEFAULT_ERR_LOG_LVL
;
...
...
@@ -612,6 +613,8 @@ long js_exec(const char *fname, char** args)
,
STRING_TO_JSVAL
(
JS_NewStringCopyZ
(
js_cx
,
rev_detail
))
,
NULL
,
NULL
,
JSPROP_READONLY
|
JSPROP_ENUMERATE
);
branch
.
terminated
=&
terminated
;
JS_SetBranchCallback
(
js_cx
,
js_BranchCallback
);
if
(
fp
==
stdin
)
/* Using stdin for script source */
...
...
@@ -669,6 +672,14 @@ void break_handler(int type)
terminated
=
TRUE
;
}
void
recycle_handler
(
int
type
)
{
fprintf
(
statfp
,
"
\n
-> Recycled Locally (signal: %d)
\n
"
,
type
);
recycled
=
TRUE
;
branch
.
terminated
=&
recycled
;
}
#if defined(_WIN32)
BOOL
WINAPI
ControlHandler
(
DWORD
CtrlType
)
{
...
...
@@ -704,7 +715,6 @@ int main(int argc, char **argv, char** environ)
branch
.
limit
=
JAVASCRIPT_BRANCH_LIMIT
;
branch
.
yield_interval
=
JAVASCRIPT_YIELD_INTERVAL
;
branch
.
gc_interval
=
JAVASCRIPT_GC_INTERVAL
;
branch
.
terminated
=&
terminated
;
branch
.
auto_terminate
=
TRUE
;
sscanf
(
"$Revision$"
,
"%*s %s"
,
revision
);
...
...
@@ -848,9 +858,13 @@ int main(int argc, char **argv, char** environ)
signal
(
SIGINT
,
break_handler
);
signal
(
SIGTERM
,
break_handler
);
/* Don't die on SIGPIPE or SIGHUP */
if
(
loop
)
signal
(
SIGHUP
,
recycle_handler
);
else
signal
(
SIGHUP
,
SIG_IGN
);
/* Don't die on SIGPIPE */
signal
(
SIGPIPE
,
SIG_IGN
);
signal
(
SIGHUP
,
SIG_IGN
);
#endif
do
{
...
...
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