Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
1fd55b73
Commit
1fd55b73
authored
Sep 24, 2012
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Get rid of the waitpid wrapper.
parent
9d5c178b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
19 deletions
+6
-19
ptrace.c
server/ptrace.c
+6
-19
No files found.
server/ptrace.c
View file @
1fd55b73
...
@@ -98,6 +98,10 @@
...
@@ -98,6 +98,10 @@
static
inline
int
ptrace
(
int
req
,
...)
{
errno
=
EPERM
;
return
-
1
;
/*FAIL*/
}
static
inline
int
ptrace
(
int
req
,
...)
{
errno
=
EPERM
;
return
-
1
;
/*FAIL*/
}
#endif
/* HAVE_SYS_PTRACE_H */
#endif
/* HAVE_SYS_PTRACE_H */
#ifndef __WALL
#define __WALL 0
#endif
/* handle a status returned by waitpid */
/* handle a status returned by waitpid */
static
int
handle_child_status
(
struct
thread
*
thread
,
int
pid
,
int
status
,
int
want_sig
)
static
int
handle_child_status
(
struct
thread
*
thread
,
int
pid
,
int
status
,
int
want_sig
)
{
{
...
@@ -130,23 +134,6 @@ static int handle_child_status( struct thread *thread, int pid, int status, int
...
@@ -130,23 +134,6 @@ static int handle_child_status( struct thread *thread, int pid, int status, int
return
0
;
return
0
;
}
}
/* waitpid wrapper to handle missing __WALL flag in older kernels */
static
inline
pid_t
waitpid_wrapper
(
pid_t
pid
,
int
*
status
,
int
options
)
{
#ifdef __WALL
static
int
wall_flag
=
__WALL
;
for
(;;)
{
pid_t
ret
=
waitpid
(
pid
,
status
,
options
|
wall_flag
);
if
(
ret
!=
-
1
||
!
wall_flag
||
errno
!=
EINVAL
)
return
ret
;
wall_flag
=
0
;
}
#else
return
waitpid
(
pid
,
status
,
options
);
#endif
}
/* handle a SIGCHLD signal */
/* handle a SIGCHLD signal */
void
sigchld_callback
(
void
)
void
sigchld_callback
(
void
)
{
{
...
@@ -154,7 +141,7 @@ void sigchld_callback(void)
...
@@ -154,7 +141,7 @@ void sigchld_callback(void)
for
(;;)
for
(;;)
{
{
if
(
!
(
pid
=
waitpid
_wrapper
(
-
1
,
&
status
,
WUNTRACED
|
WNOHANG
)))
break
;
if
(
!
(
pid
=
waitpid
(
-
1
,
&
status
,
WUNTRACED
|
WNOHANG
|
__WALL
)))
break
;
if
(
pid
!=
-
1
)
if
(
pid
!=
-
1
)
{
{
struct
thread
*
thread
=
get_thread_from_tid
(
pid
);
struct
thread
*
thread
=
get_thread_from_tid
(
pid
);
...
@@ -189,7 +176,7 @@ static int waitpid_thread( struct thread *thread, int signal )
...
@@ -189,7 +176,7 @@ static int waitpid_thread( struct thread *thread, int signal )
start_watchdog
();
start_watchdog
();
for
(;;)
for
(;;)
{
{
if
((
res
=
waitpid
_wrapper
(
get_ptrace_pid
(
thread
),
&
status
,
WUNTRACED
))
==
-
1
)
if
((
res
=
waitpid
(
get_ptrace_pid
(
thread
),
&
status
,
WUNTRACED
|
__WALL
))
==
-
1
)
{
{
if
(
errno
==
EINTR
)
if
(
errno
==
EINTR
)
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment