aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2024-12-16 09:12:48 -0700
committerTom Tromey <tom@tromey.com>2024-12-16 13:16:04 -0700
commit7a8cc0983ae3b954cba68dc874b0b0e738347e79 (patch)
treeed8f64faecb0afa2e7d5860a4e13da9694a705f0
parent975cb893f45de2a927e226883e7a76ee5e333baa (diff)
downloadbinutils-7a8cc0983ae3b954cba68dc874b0b0e738347e79.zip
binutils-7a8cc0983ae3b954cba68dc874b0b0e738347e79.tar.gz
binutils-7a8cc0983ae3b954cba68dc874b0b0e738347e79.tar.bz2
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>
-rw-r--r--sim/common/dv-sockser.c2
-rw-r--r--sim/common/nrun.c2
-rw-r--r--sim/ppc/main.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/sim/common/dv-sockser.c b/sim/common/dv-sockser.c
index db81233..e766425 100644
--- a/sim/common/dv-sockser.c
+++ b/sim/common/dv-sockser.c
@@ -175,7 +175,7 @@ dv_sockser_init (SIM_DESC sd)
??? Need a central signal management module. */
#ifdef SIGPIPE
{
- RETSIGTYPE (*orig) ();
+ RETSIGTYPE (*orig) (int);
orig = signal (SIGPIPE, SIG_IGN);
/* If a handler is already set up, don't mess with it. */
if (orig != SIG_DFL && orig != SIG_IGN)
diff --git a/sim/common/nrun.c b/sim/common/nrun.c
index 5dd3bc2..fc63bae 100644
--- a/sim/common/nrun.c
+++ b/sim/common/nrun.c
@@ -64,7 +64,7 @@ main (int argc, char **argv)
enum sim_stop reason;
int sigrc = 0;
int single_step = 0;
- RETSIGTYPE (*prev_sigint) ();
+ RETSIGTYPE (*prev_sigint) (int);
myname = lbasename (argv[0]);
diff --git a/sim/ppc/main.c b/sim/ppc/main.c
index aa1c85e..987e89e 100644
--- a/sim/ppc/main.c
+++ b/sim/ppc/main.c
@@ -289,7 +289,7 @@ main(int argc, char * const *argv)
psim_stack(simulation, argv, environ);
{
- RETSIGTYPE (*prev) ();
+ RETSIGTYPE (*prev) (int);
prev = signal(SIGINT, cntrl_c);
psim_run(simulation);
signal(SIGINT, prev);