mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-22 11:00:01 +08:00
gdb::handle_eintr, remove need to specify return type
This eliminates the need to specify the return type when using handle_eintr. We let the compiler deduce it for us. Also, use lowercase for function parameter names. Uppercase should only be used on template parameters. gdb/ChangeLog: * nat/linux-waitpid.c: Include "gdbsupport/eintr.h". (my_waitpid): Use gdb::handle_eintr. gdbserver/ChangeLog: * netbsd-low.cc (netbsd_waitpid, netbsd_process_target::kill) (netbsd_qxfer_libraries_svr4): Use gdb::handle_eintr without explicit type. gdbsupport/ChangeLog: * eintr.h (handle_eintr): Replace Ret template parameter with ErrorValType. Use it as type of the failure value. Deduce the function's return type using decltype. Use lowercase for function parameter names.
This commit is contained in:
@ -22,6 +22,7 @@
|
||||
#include "linux-nat.h"
|
||||
#include "linux-waitpid.h"
|
||||
#include "gdbsupport/gdb_wait.h"
|
||||
#include "gdbsupport/eintr.h"
|
||||
|
||||
/* Convert wait status STATUS to a string. Used for printing debug
|
||||
messages only. */
|
||||
@ -54,13 +55,5 @@ status_to_str (int status)
|
||||
int
|
||||
my_waitpid (int pid, int *status, int flags)
|
||||
{
|
||||
int ret;
|
||||
|
||||
do
|
||||
{
|
||||
ret = waitpid (pid, status, flags);
|
||||
}
|
||||
while (ret == -1 && errno == EINTR);
|
||||
|
||||
return ret;
|
||||
return gdb::handle_eintr (-1, ::waitpid, pid, status, flags);
|
||||
}
|
||||
|
Reference in New Issue
Block a user