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
9d5c178b
Commit
9d5c178b
authored
Sep 24, 2012
by
Adrian Bunk
Committed by
Alexandre Julliard
Sep 24, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Use waitpid() instead of wait4().
parent
934293c1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
25 deletions
+14
-25
configure
configure
+1
-3
configure.ac
configure.ac
+1
-3
config.h.in
include/config.h.in
+0
-6
ptrace.c
server/ptrace.c
+11
-11
request.c
server/request.c
+1
-1
nativeapi.dat
tools/winapi/nativeapi.dat
+0
-1
No files found.
configure
View file @
9d5c178b
...
...
@@ -12994,9 +12994,7 @@ for ac_func in \
thr_kill2
\
timegm
\
usleep
\
vsnprintf
\
wait4
\
waitpid
\
vsnprintf
do
:
as_ac_var
=
`
$as_echo
"ac_cv_func_
$ac_func
"
|
$as_tr_sh
`
...
...
configure.ac
View file @
9d5c178b
...
...
@@ -2046,9 +2046,7 @@ AC_CHECK_FUNCS(\
thr_kill2 \
timegm \
usleep \
vsnprintf \
wait4 \
waitpid \
vsnprintf
)
CFLAGS="$ac_save_CFLAGS"
...
...
include/config.h.in
View file @
9d5c178b
...
...
@@ -1076,12 +1076,6 @@
/* Define to 1 if you have the `vsnprintf' function. */
#undef HAVE_VSNPRINTF
/* Define to 1 if you have the `wait4' function. */
#undef HAVE_WAIT4
/* Define to 1 if you have the `waitpid' function. */
#undef HAVE_WAITPID
/* Define to 1 if you have the <X11/extensions/shape.h> header file. */
#undef HAVE_X11_EXTENSIONS_SHAPE_H
...
...
server/ptrace.c
View file @
9d5c178b
...
...
@@ -98,7 +98,7 @@
static
inline
int
ptrace
(
int
req
,
...)
{
errno
=
EPERM
;
return
-
1
;
/*FAIL*/
}
#endif
/* HAVE_SYS_PTRACE_H */
/* handle a status returned by wait
4
*/
/* handle a status returned by wait
pid
*/
static
int
handle_child_status
(
struct
thread
*
thread
,
int
pid
,
int
status
,
int
want_sig
)
{
if
(
WIFSTOPPED
(
status
))
...
...
@@ -130,20 +130,20 @@ static int handle_child_status( struct thread *thread, int pid, int status, int
return
0
;
}
/* wait
4
wrapper to handle missing __WALL flag in older kernels */
static
inline
pid_t
wait
4_wrapper
(
pid_t
pid
,
int
*
status
,
int
options
,
struct
rusage
*
usage
)
/* wait
pid
wrapper to handle missing __WALL flag in older kernels */
static
inline
pid_t
wait
pid_wrapper
(
pid_t
pid
,
int
*
status
,
int
options
)
{
#ifdef __WALL
static
int
wall_flag
=
__WALL
;
for
(;;)
{
pid_t
ret
=
wait
4
(
pid
,
status
,
options
|
wall_flag
,
usage
);
pid_t
ret
=
wait
pid
(
pid
,
status
,
options
|
wall_flag
);
if
(
ret
!=
-
1
||
!
wall_flag
||
errno
!=
EINVAL
)
return
ret
;
wall_flag
=
0
;
}
#else
return
wait
4
(
pid
,
status
,
options
,
usage
);
return
wait
pid
(
pid
,
status
,
options
);
#endif
}
...
...
@@ -154,7 +154,7 @@ void sigchld_callback(void)
for
(;;)
{
if
(
!
(
pid
=
wait
4_wrapper
(
-
1
,
&
status
,
WUNTRACED
|
WNOHANG
,
NULL
)))
break
;
if
(
!
(
pid
=
wait
pid_wrapper
(
-
1
,
&
status
,
WUNTRACED
|
WNOHANG
)))
break
;
if
(
pid
!=
-
1
)
{
struct
thread
*
thread
=
get_thread_from_tid
(
pid
);
...
...
@@ -182,26 +182,26 @@ static int get_ptrace_tid( struct thread *thread )
}
/* wait for a ptraced child to get a certain signal */
static
int
wait
4
_thread
(
struct
thread
*
thread
,
int
signal
)
static
int
wait
pid
_thread
(
struct
thread
*
thread
,
int
signal
)
{
int
res
,
status
;
start_watchdog
();
for
(;;)
{
if
((
res
=
wait
4_wrapper
(
get_ptrace_pid
(
thread
),
&
status
,
WUNTRACED
,
NULL
))
==
-
1
)
if
((
res
=
wait
pid_wrapper
(
get_ptrace_pid
(
thread
),
&
status
,
WUNTRACED
))
==
-
1
)
{
if
(
errno
==
EINTR
)
{
if
(
!
watchdog_triggered
())
continue
;
if
(
debug_level
)
fprintf
(
stderr
,
"%04x: *watchdog* wait
4
aborted
\n
"
,
thread
->
id
);
if
(
debug_level
)
fprintf
(
stderr
,
"%04x: *watchdog* wait
pid
aborted
\n
"
,
thread
->
id
);
}
else
if
(
errno
==
ECHILD
)
/* must have died */
{
thread
->
unix_pid
=
-
1
;
thread
->
unix_tid
=
-
1
;
}
else
perror
(
"wait
4
"
);
else
perror
(
"wait
pid
"
);
stop_watchdog
();
return
0
;
}
...
...
@@ -292,7 +292,7 @@ static int suspend_for_ptrace( struct thread *thread )
if
(
errno
==
ESRCH
)
thread
->
unix_pid
=
thread
->
unix_tid
=
-
1
;
/* thread got killed */
goto
error
;
}
if
(
wait
4
_thread
(
thread
,
SIGSTOP
))
return
1
;
if
(
wait
pid
_thread
(
thread
,
SIGSTOP
))
return
1
;
resume_after_ptrace
(
thread
);
error:
set_error
(
STATUS_ACCESS_DENIED
);
...
...
server/request.c
View file @
9d5c178b
...
...
@@ -801,7 +801,7 @@ void open_master_socket(void)
if
(
read
(
sync_pipe
[
0
],
&
dummy
,
1
)
==
1
)
_exit
(
0
);
/* child terminated, propagate exit status */
wait
4
(
pid
,
&
status
,
0
,
NULL
);
wait
pid
(
pid
,
&
status
,
0
);
if
(
WIFEXITED
(
status
))
_exit
(
WEXITSTATUS
(
status
)
);
_exit
(
1
);
}
...
...
tools/winapi/nativeapi.dat
View file @
9d5c178b
...
...
@@ -251,7 +251,6 @@ utime
vfprintf
vsnprintf
vsprintf
wait4
write
y0
y1
...
...
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