forked from Imagelibrary/binutils-gdb
[gdb] Add gdb::wait
Add gdb::wait, and use it in gdb/procfs.c, making sure that EINTR is handled. Tested on x86_64-linux.
This commit is contained in:
@@ -2062,8 +2062,9 @@ wait_again:
|
|||||||
{
|
{
|
||||||
int wait_retval;
|
int wait_retval;
|
||||||
|
|
||||||
/* /proc file not found; presumably child has terminated. */
|
/* /proc file not found; presumably child has terminated. Wait
|
||||||
wait_retval = ::wait (&wstat); /* "wait" for the child's exit. */
|
for the child's exit. */
|
||||||
|
wait_retval = gdb::wait (&wstat);
|
||||||
|
|
||||||
/* Wrong child? */
|
/* Wrong child? */
|
||||||
if (wait_retval != inf->pid)
|
if (wait_retval != inf->pid)
|
||||||
@@ -2150,7 +2151,7 @@ wait_again:
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int temp = ::wait (&wstat);
|
int temp = gdb::wait (&wstat);
|
||||||
|
|
||||||
/* FIXME: shouldn't I make sure I get the right
|
/* FIXME: shouldn't I make sure I get the right
|
||||||
event from the right process? If (for
|
event from the right process? If (for
|
||||||
@@ -2562,7 +2563,7 @@ unconditionally_kill_inferior (procinfo *pi)
|
|||||||
|
|
||||||
ret = gdb::waitpid (pi->pid, &status, 0);
|
ret = gdb::waitpid (pi->pid, &status, 0);
|
||||||
#else
|
#else
|
||||||
wait (NULL);
|
gdb::wait (NULL);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,6 +83,12 @@ open (const char *pathname, int flags)
|
|||||||
return gdb::handle_eintr (-1, ::open, pathname, flags);
|
return gdb::handle_eintr (-1, ::open, pathname, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline pid_t
|
||||||
|
wait (int *wstatus)
|
||||||
|
{
|
||||||
|
return gdb::handle_eintr (-1, ::wait, wstatus);
|
||||||
|
}
|
||||||
|
|
||||||
inline int
|
inline int
|
||||||
close (int fd)
|
close (int fd)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user