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
62cb464d
Commit
62cb464d
authored
22 years ago
by
deuce
Browse files
Options
Downloads
Patches
Plain Diff
More NetBSD/QNX fixes... also, fixed error where a failed fork() on a
background process wiyld take down the whole BBS.
parent
15d96ff3
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/sbbs3/scfg/GNUmakefile
+2
-3
2 additions, 3 deletions
src/sbbs3/scfg/GNUmakefile
src/sbbs3/xtrn.cpp
+9
-5
9 additions, 5 deletions
src/sbbs3/xtrn.cpp
with
11 additions
and
8 deletions
src/sbbs3/scfg/GNUmakefile
+
2
−
3
View file @
62cb464d
...
@@ -80,9 +80,8 @@ endif
...
@@ -80,9 +80,8 @@ endif
include
targets.mk
# defines all targets
include
targets.mk
# defines all targets
include
objects.mk
# defines $(OBJS)
include
objects.mk
# defines $(OBJS)
ifeq
($(os),gnu)
ifeq
($(os),netbsd)
OBJS
+=
$(
ODIR
)$(
SLASH
)
sem.
$(
OFILE
)
CFLAGS
+=
-D__unix__
CFLAGS
+=
-D_NEED_SEM
endif
endif
ifdef
USE_DIALOG
ifdef
USE_DIALOG
...
...
This diff is collapsed.
Click to expand it.
src/sbbs3/xtrn.cpp
+
9
−
5
View file @
62cb464d
...
@@ -53,7 +53,11 @@
...
@@ -53,7 +53,11 @@
#elif defined(__linux__)
#elif defined(__linux__)
#include
<pty.h>
#include
<pty.h>
#elif defined(__QNX__)
#elif defined(__QNX__)
#if 0
#include <unix.h>
#include <unix.h>
#else
#define NEEDS_FORKPTY
#endif
#endif
#endif
#ifdef NEEDS_FORKPTY
#ifdef NEEDS_FORKPTY
...
@@ -1064,7 +1068,7 @@ static int forkpty(int *amaster, char *name, termios *termp, winsize *winp)
...
@@ -1064,7 +1068,7 @@ static int forkpty(int *amaster, char *name, termios *termp, winsize *winp)
if
(
openpty
(
&
master
,
&
slave
,
name
,
termp
,
winp
)
==
-
1
)
if
(
openpty
(
&
master
,
&
slave
,
name
,
termp
,
winp
)
==
-
1
)
return
(
-
1
);
return
(
-
1
);
switch
(
pid
=
fork
())
{
switch
(
pid
=
v
fork
())
{
case
-
1
:
case
-
1
:
return
(
-
1
);
return
(
-
1
);
case
0
:
case
0
:
...
@@ -1235,7 +1239,7 @@ int sbbs_t::external(const char* cmdline, long mode, const char* startup_dir)
...
@@ -1235,7 +1239,7 @@ int sbbs_t::external(const char* cmdline, long mode, const char* startup_dir)
}
}
if
((
pid
=
fork
())
==-
1
)
{
if
((
pid
=
v
fork
())
==-
1
)
{
pthread_mutex_unlock
(
&
input_thread_mutex
);
pthread_mutex_unlock
(
&
input_thread_mutex
);
errormsg
(
WHERE
,
ERR_EXEC
,
fullcmdline
,
0
);
errormsg
(
WHERE
,
ERR_EXEC
,
fullcmdline
,
0
);
return
(
-
1
);
return
(
-
1
);
...
@@ -1292,15 +1296,15 @@ int sbbs_t::external(const char* cmdline, long mode, const char* startup_dir)
...
@@ -1292,15 +1296,15 @@ int sbbs_t::external(const char* cmdline, long mode, const char* startup_dir)
if
(
mode
&
EX_BG
)
/* background execution, detach child */
if
(
mode
&
EX_BG
)
/* background execution, detach child */
{
{
if
(
fork
())
if
(
v
fork
())
exit
(
0
);
return
(
0
);
lprintf
(
"Detaching external process pgid=%d"
,
setsid
());
lprintf
(
"Detaching external process pgid=%d"
,
setsid
());
}
}
execvp
(
argv
[
0
],
argv
);
execvp
(
argv
[
0
],
argv
);
sprintf
(
str
,
"!ERROR %d executing %s"
,
errno
,
argv
[
0
]);
sprintf
(
str
,
"!ERROR %d executing %s"
,
errno
,
argv
[
0
]);
errorlog
(
str
);
errorlog
(
str
);
exit
(
-
1
);
/* should never get here */
_
exit
(
-
1
);
/* should never get here */
}
}
lprintf
(
"Node %d executing external: %s"
,
cfg
.
node_num
,
fullcmdline
);
lprintf
(
"Node %d executing external: %s"
,
cfg
.
node_num
,
fullcmdline
);
...
...
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