Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pike
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
Container Registry
Model registry
Operate
Environments
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
pikelang
pike
Commits
73e1dc18
Commit
73e1dc18
authored
26 years ago
by
Fredrik Hübinette (Hubbe)
Browse files
Options
Downloads
Patches
Plain Diff
bugfixes in process handling
Rev: src/signal_handler.c:1.60
parent
2e104a23
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/signal_handler.c
+54
-21
54 additions, 21 deletions
src/signal_handler.c
with
54 additions
and
21 deletions
src/signal_handler.c
+
54
−
21
View file @
73e1dc18
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
#include
"builtin_functions.h"
#include
"builtin_functions.h"
#include
<signal.h>
#include
<signal.h>
RCSID
(
"$Id: signal_handler.c,v 1.
59
1998/05/0
5 13:26:48 marcus
Exp $"
);
RCSID
(
"$Id: signal_handler.c,v 1.
60
1998/05/0
6 00:32:02 hubbe
Exp $"
);
#ifdef HAVE_PASSWD_H
#ifdef HAVE_PASSWD_H
# include <passwd.h>
# include <passwd.h>
...
@@ -346,7 +346,7 @@ static RETSIGTYPE receive_signal(int signum)
...
@@ -346,7 +346,7 @@ static RETSIGTYPE receive_signal(int signum)
{
{
int
tmp
;
int
tmp
;
#ifdef DEBUG
#ifdef DEBUG
if
(
signum
<
0
||
signum
>=
MAX_SIGNALS
)
if
(
signum
<
0
||
signum
>=
MAX_SIGNALS
)
fatal
(
"Received signal %u >= %u!!!
\n
"
,
signum
,
MAX_SIGNALS
);
fatal
(
"Received signal %u >= %u!!!
\n
"
,
signum
,
MAX_SIGNALS
);
#endif
#endif
...
@@ -517,24 +517,43 @@ static void f_pid_status_wait(INT32 args)
...
@@ -517,24 +517,43 @@ static void f_pid_status_wait(INT32 args)
#else
#else
#if 1
#if 1
while
(
THIS
->
state
==
PROCESS_RUNNING
)
{
{
int
pid
,
status
;
int
err
=
0
;
pid
=
THIS
->
pid
;
while
(
THIS
->
state
==
PROCESS_RUNNING
)
THREADS_ALLOW
();
{
int
pid
,
status
;
pid
=
THIS
->
pid
;
if
(
err
)
error
(
"Pike lost track of a child, pid=%d, errno=%d.
\n
"
,
pid
,
err
);
THREADS_ALLOW
();
#ifdef HAVE_WAITPID
#ifdef HAVE_WAITPID
pid
=
waitpid
(
pid
,
&
status
,
0
);
pid
=
waitpid
(
pid
,
&
status
,
0
);
#else
#else
#ifdef HAVE_WAIT4
#ifdef HAVE_WAIT4
pid
=
wait4
(
pid
,
&
status
,
0
,
0
);
pid
=
wait4
(
pid
,
&
status
,
0
,
0
);
#else
#else
pid
=-
1
;
pid
=-
1
;
#endif
#endif
#endif
#endif
THREADS_DISALLOW
();
THREADS_DISALLOW
();
if
(
pid
>
-
1
)
if
(
pid
>
-
1
)
report_child
(
pid
,
status
);
{
check_signals
(
0
,
0
,
0
);
report_child
(
pid
,
status
);
}
else
{
switch
(
errno
)
{
case
EINTR
:
break
;
default:
err
=
errno
;
}
}
check_signals
(
0
,
0
,
0
);
}
}
}
#else
#else
init_signal_wait
();
init_signal_wait
();
...
@@ -599,6 +618,27 @@ static HANDLE get_inheritable_handle(struct mapping *optional,
...
@@ -599,6 +618,27 @@ static HANDLE get_inheritable_handle(struct mapping *optional,
if
(
fd
==
-
1
)
if
(
fd
==
-
1
)
error
(
"File for %s is not open.
\n
"
,
name
);
error
(
"File for %s is not open.
\n
"
,
name
);
#if 0
{
int q;
for(q=0;q<MAX_OPEN_FILEDESCRIPTORS;q++)
{
if(fd_type[q]<-1)
{
DWORD flags;
fprintf(stderr,"%3d: %d %08x",q,fd_type[q],da_handle[q],flags);
GetHandleInformation((HANDLE)da_handle[q],&flags);
if(flags & HANDLE_FLAG_INHERIT)
fprintf(stderr," inheritable");
if(flags & HANDLE_FLAG_PROTECT_FROM_CLOSE)
fprintf(stderr," non-closable");
fprintf(stderr,"\n");
}
}
}
#endif
if
(
!
(
fd_query_properties
(
fd
,
0
)
&
fd_INTERPROCESSABLE
))
if
(
!
(
fd_query_properties
(
fd
,
0
)
&
fd_INTERPROCESSABLE
))
{
{
void
create_proxy_pipe
(
struct
object
*
o
,
int
for_reading
);
void
create_proxy_pipe
(
struct
object
*
o
,
int
for_reading
);
...
@@ -1215,14 +1255,7 @@ void f_create_process(INT32 args)
...
@@ -1215,14 +1255,7 @@ void f_create_process(INT32 args)
#ifdef HAVE_NICE
#ifdef HAVE_NICE
if
((
tmp
=
low_mapping_string_lookup
(
optional
,
storage
.
nice_s
)))
{
if
((
tmp
=
low_mapping_string_lookup
(
optional
,
storage
.
nice_s
)))
{
if
(
tmp
->
type
==
T_INT
)
{
if
(
tmp
->
type
==
T_INT
)
{
int
n
=
nice
(
0
);
nice
(
tmp
->
u
.
integer
);
int
nn
=
tmp
->
u
.
integer
;
if
(
nn
>
(
NZERO
-
1
))
{
nn
=
NZERO
-
1
;
}
nice
(
nn
-
n
);
}
}
}
}
#endif
/* HAVE_NICE */
#endif
/* HAVE_NICE */
...
...
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