mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-05 15:15:42 +00:00
Use correct type for saved signal handler
A user noticed that the sim assigns the result of a call to 'signal' to a variable like: RETSIGTYPE (*prev_sigint) (); However, it's more correct to use (int) here. This patch fixes the error. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32466 Approved-By: Andrew Burgess <aburgess@redhat.com>
This commit is contained in:
@@ -175,7 +175,7 @@ dv_sockser_init (SIM_DESC sd)
|
|||||||
??? Need a central signal management module. */
|
??? Need a central signal management module. */
|
||||||
#ifdef SIGPIPE
|
#ifdef SIGPIPE
|
||||||
{
|
{
|
||||||
RETSIGTYPE (*orig) ();
|
RETSIGTYPE (*orig) (int);
|
||||||
orig = signal (SIGPIPE, SIG_IGN);
|
orig = signal (SIGPIPE, SIG_IGN);
|
||||||
/* If a handler is already set up, don't mess with it. */
|
/* If a handler is already set up, don't mess with it. */
|
||||||
if (orig != SIG_DFL && orig != SIG_IGN)
|
if (orig != SIG_DFL && orig != SIG_IGN)
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ main (int argc, char **argv)
|
|||||||
enum sim_stop reason;
|
enum sim_stop reason;
|
||||||
int sigrc = 0;
|
int sigrc = 0;
|
||||||
int single_step = 0;
|
int single_step = 0;
|
||||||
RETSIGTYPE (*prev_sigint) ();
|
RETSIGTYPE (*prev_sigint) (int);
|
||||||
|
|
||||||
myname = lbasename (argv[0]);
|
myname = lbasename (argv[0]);
|
||||||
|
|
||||||
|
|||||||
@@ -289,7 +289,7 @@ main(int argc, char * const *argv)
|
|||||||
psim_stack(simulation, argv, environ);
|
psim_stack(simulation, argv, environ);
|
||||||
|
|
||||||
{
|
{
|
||||||
RETSIGTYPE (*prev) ();
|
RETSIGTYPE (*prev) (int);
|
||||||
prev = signal(SIGINT, cntrl_c);
|
prev = signal(SIGINT, cntrl_c);
|
||||||
psim_run(simulation);
|
psim_run(simulation);
|
||||||
signal(SIGINT, prev);
|
signal(SIGINT, prev);
|
||||||
|
|||||||
Reference in New Issue
Block a user