]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Use correct type for saved signal handler
authorTom Tromey <tom@tromey.com>
Mon, 16 Dec 2024 16:12:48 +0000 (09:12 -0700)
committerTom Tromey <tom@tromey.com>
Mon, 16 Dec 2024 20:16:04 +0000 (13:16 -0700)
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>
sim/common/dv-sockser.c
sim/common/nrun.c
sim/ppc/main.c

index db81233e25bcc033d35b826991382284c1e2968f..e7664254a4eec92700608ec696b86a063752fd26 100644 (file)
@@ -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)
index 5dd3bc284bd8f5a9605b1b72c09ebec5c9e5505e..fc63baeb8a7c4be03be5975a71e653002ab8c505 100644 (file)
@@ -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]);
 
index aa1c85e0af913b90d66e94c5fbd432c1bd1ebfef..987e89ea32aec5fae64891bca8baca8051415eb0 100644 (file)
@@ -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);