From 8befda6490c40a03270d08224d454a304741ce0d Mon Sep 17 00:00:00 2001
From: David Lawrence Ramsey <pooka109@gmail.com>
Date: Tue, 6 Dec 2005 19:39:56 +0000
Subject: [PATCH] readd RETSIGTYPE return types for signal handlers, since any
 problems with its being defined as the wrong type aren't nano's fault

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3235 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
---
 ChangeLog   |  7 +++++++
 src/nano.c  | 10 +++++-----
 src/proto.h | 10 +++++-----
 src/text.c  |  2 +-
 4 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d33221d1..e87c958d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -120,6 +120,10 @@ CVS code -
 	- Adjust copyright notices in all source files to account for
 	  Chris' reassigning the 2005-2006 copyright on nano to me.
 	  Changes to do_credits(). (DLR)
+	- Readd RETSIGTYPE return types for signal handlers, since any
+	  problems with its being defined as the wrong type aren't
+	  nano's fault.  Changes to handle_hupterm(), do_suspend(),
+	  do_continue(), handle_sigwinch(), and cancel_command(). (DLR)
 - browser.c:
   do_browser()
 	- When setting the width of each file, use the "?" operator
@@ -155,6 +159,9 @@ CVS code -
 	- If DISABLE_WRAPPING is defined, the code in DISABLE_ROOTWRAP
 	  #ifdefs isn't included, so don't display
 	  "--disable-wrapping-as-root" in that case. (DLR)
+  do_cont()
+	- Rename to do_continue(), and rename parameter s to signal, for
+	  consistency. (DLR)
   do_verbatim_input()
 	- Move to text.c, since it's an advanced text-based operation.
 	  (DLR)
diff --git a/src/nano.c b/src/nano.c
index 4708ca57..c1c73402 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -963,19 +963,19 @@ void signal_init(void)
 	act.sa_handler = do_suspend;
 	sigaction(SIGTSTP, &act, NULL);
 
-	act.sa_handler = do_cont;
+	act.sa_handler = do_continue;
 	sigaction(SIGCONT, &act, NULL);
     }
 }
 
 /* Handler for SIGHUP (hangup) and SIGTERM (terminate). */
-void handle_hupterm(int signal)
+RETSIGTYPE handle_hupterm(int signal)
 {
     die(_("Received SIGHUP or SIGTERM\n"));
 }
 
 /* Handler for SIGTSTP (suspend). */
-void do_suspend(int signal)
+RETSIGTYPE do_suspend(int signal)
 {
     endwin();
     printf("\n\n\n\n\n%s\n", _("Use \"fg\" to return to nano"));
@@ -995,7 +995,7 @@ void do_suspend(int signal)
 }
 
 /* Handler for SIGCONT (continue after suspend). */
-void do_cont(int signal)
+RETSIGTYPE do_continue(int signal)
 {
 #ifndef NANO_TINY
     /* Perhaps the user resized the window while we slept.  Handle it,
@@ -1008,7 +1008,7 @@ void do_cont(int signal)
 }
 
 #ifndef NANO_TINY
-void handle_sigwinch(int s)
+RETSIGTYPE handle_sigwinch(int signal)
 {
     const char *tty = ttyname(0);
     int fd, result = 0;
diff --git a/src/proto.h b/src/proto.h
index a1ec2692..2574ca72 100644
--- a/src/proto.h
+++ b/src/proto.h
@@ -401,11 +401,11 @@ int no_help(void);
 void nano_disabled_msg(void);
 void do_exit(void);
 void signal_init(void);
-void handle_hupterm(int signal);
-void do_suspend(int signal);
-void do_cont(int signal);
+RETSIGTYPE handle_hupterm(int signal);
+RETSIGTYPE do_suspend(int signal);
+RETSIGTYPE do_continue(int signal);
 #ifndef NANO_TINY
-void handle_sigwinch(int s);
+RETSIGTYPE handle_sigwinch(int signal);
 void allow_pending_sigwinch(bool allow);
 #endif
 #ifndef NANO_TINY
@@ -556,7 +556,7 @@ void do_backspace(void);
 void do_tab(void);
 void do_enter(void);
 #ifndef NANO_TINY
-void cancel_command(int signal);
+RETSIGTYPE cancel_command(int signal);
 bool execute_command(const char *command);
 #endif
 #ifndef DISABLE_WRAPPING
diff --git a/src/text.c b/src/text.c
index 487fd744..83eacd4f 100644
--- a/src/text.c
+++ b/src/text.c
@@ -247,7 +247,7 @@ void do_enter(void)
 }
 
 #ifndef NANO_TINY
-void cancel_command(int signal)
+RETSIGTYPE cancel_command(int signal)
 {
     if (kill(pid, SIGKILL) == -1)
 	nperror("kill");
-- 
GitLab