summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@redhat.com>2010-02-19 11:27:56 +0100
committerStefan Metzmacher <metze@samba.org>2010-02-23 12:23:45 +0100
commit13e2f5f971eeaa7b342baeaee55ff52b089ac881 (patch)
tree9a829bef3bb7f529c95bbcb61c663f60a10e04dd
parent8ac0c9fc67c8c07d0680cb069677f58434dc893e (diff)
downloadsamba-13e2f5f971eeaa7b342baeaee55ff52b089ac881.tar.gz
samba-13e2f5f971eeaa7b342baeaee55ff52b089ac881.tar.bz2
samba-13e2f5f971eeaa7b342baeaee55ff52b089ac881.zip
libreplace: Remove the obsolete signal type cast.
AC_SIGNAL_TYPE is already obsolete in autoconf. C89 requires signal handlers to return void, only K&R returned int.
-rw-r--r--lib/replace/getpass.c12
-rw-r--r--lib/replace/libreplace.m41
-rw-r--r--lib/replace/system/wait.h4
3 files changed, 4 insertions, 13 deletions
diff --git a/lib/replace/getpass.c b/lib/replace/getpass.c
index aab53c533d..f95109f2b4 100644
--- a/lib/replace/getpass.c
+++ b/lib/replace/getpass.c
@@ -34,10 +34,6 @@ typedef int sig_atomic_t;
#define SIGCLD SIGCHLD
#endif
-#ifndef SIGNAL_CAST
-#define SIGNAL_CAST (RETSIGTYPE (*)(int))
-#endif
-
#ifdef SYSV_TERMIO
/* SYSTEM V TERMIO HANDLING */
@@ -99,7 +95,7 @@ static int tcsetattr(int fd, int flags, struct sgttyb *_t)
static struct termios t;
#endif /* SYSV_TERMIO */
-static void catch_signal(int signum,void (*handler)(int ))
+static void catch_signal(int signum, void (*handler)(int ))
{
#ifdef HAVE_SIGACTION
struct sigaction act;
@@ -131,7 +127,7 @@ static int in_fd = -1;
Signal function to tell us were ^C'ed.
****************************************************************/
-static void gotintr_sig(void)
+static void gotintr_sig(int signum)
{
gotintr = 1;
if (in_fd != -1)
@@ -148,7 +144,7 @@ char *rep_getpass(const char *prompt)
size_t nread;
/* Catch problematic signals */
- catch_signal(SIGINT, SIGNAL_CAST gotintr_sig);
+ catch_signal(SIGINT, gotintr_sig);
/* Try to write to and read from the terminal if we can.
If we can't open the terminal, use stderr and stdin. */
@@ -211,7 +207,7 @@ char *rep_getpass(const char *prompt)
fclose(in);
/* Catch problematic signals */
- catch_signal(SIGINT, SIGNAL_CAST SIG_DFL);
+ catch_signal(SIGINT, SIG_DFL);
if (gotintr) {
printf("Interrupted by signal.\n");
diff --git a/lib/replace/libreplace.m4 b/lib/replace/libreplace.m4
index d7873dbb67..c8cd213b83 100644
--- a/lib/replace/libreplace.m4
+++ b/lib/replace/libreplace.m4
@@ -51,7 +51,6 @@ AC_SUBST(LIBREPLACEOBJ)
LIBREPLACEOBJ="${LIBREPLACEOBJ} $libreplacedir/snprintf.o"
-AC_TYPE_SIGNAL
AC_TYPE_UID_T
AC_TYPE_MODE_T
AC_TYPE_OFF_T
diff --git a/lib/replace/system/wait.h b/lib/replace/system/wait.h
index 79583ad2ab..41db1806a5 100644
--- a/lib/replace/system/wait.h
+++ b/lib/replace/system/wait.h
@@ -36,10 +36,6 @@
#define SIGCLD SIGCHLD
#endif
-#ifndef SIGNAL_CAST
-#define SIGNAL_CAST (RETSIGTYPE (*)(int))
-#endif
-
#ifdef HAVE_SETJMP_H
#include <setjmp.h>
#endif