summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmadeusz Sławiński (amade) <amade@asmblr.net>2011-04-09 23:44:02 +0200
committerAmadeusz Sławiński <amade@asmblr.net>2014-07-24 11:50:46 +0200
commitbbc180c43474e9b294395163603f49a4d19a79c8 (patch)
treed29a2dfa8bf4153647d128ba61227fcf7016b75d
parenta0953871a6defeac6499eac97391cd3fa98cd048 (diff)
downloadscreen-bbc180c43474e9b294395163603f49a4d19a79c8.tar.gz
remove SIGARG SIGPROTOARG SIGDEFARG macros
seems like all normal systems have it
-rw-r--r--src/attacher.c48
-rw-r--r--src/extern.h6
-rw-r--r--src/misc.c14
-rw-r--r--src/os.h15
-rw-r--r--src/pty.c4
-rw-r--r--src/screen.c18
-rw-r--r--src/tty.sh8
7 files changed, 49 insertions, 64 deletions
diff --git a/src/attacher.c b/src/attacher.c
index 6615d51..c8aa746 100644
--- a/src/attacher.c
+++ b/src/attacher.c
@@ -38,18 +38,18 @@
#include <pwd.h>
static int WriteMessage (int, struct msg *);
-static sigret_t AttacherSigInt SIGPROTOARG;
+static sigret_t AttacherSigInt (int);
#if defined(SIGWINCH) && defined(TIOCGWINSZ)
-static sigret_t AttacherWinch SIGPROTOARG;
+static sigret_t AttacherWinch (int);
#endif
-static sigret_t DoLock SIGPROTOARG;
+static sigret_t DoLock (int);
static void LockTerminal (void);
-static sigret_t LockHup SIGPROTOARG;
+static sigret_t LockHup (int);
static void screen_builtin_lck (void);
#ifdef DEBUG
-static sigret_t AttacherChld SIGPROTOARG;
+static sigret_t AttacherChld (int);
#endif
-static sigret_t AttachSigCont SIGPROTOARG;
+static sigret_t AttachSigCont (int);
# ifndef USE_SETEUID
@@ -60,7 +60,7 @@ static int multipipe[2];
static int ContinuePlease;
static sigret_t
-AttachSigCont SIGDEFARG
+AttachSigCont (int sigsig)
{
debug("SigCont()\n");
ContinuePlease = 1;
@@ -70,14 +70,14 @@ AttachSigCont SIGDEFARG
static int QueryResult;
static sigret_t
-QueryResultSuccess SIGDEFARG
+QueryResultSuccess (int sigsig)
{
QueryResult = 1;
SIGRETURN;
}
static sigret_t
-QueryResultFail SIGDEFARG
+QueryResultFail (int sigsig)
{
QueryResult = 2;
SIGRETURN;
@@ -394,7 +394,7 @@ static int AttacherPanic = 0;
#ifdef DEBUG
static sigret_t
-AttacherChld SIGDEFARG
+AttacherChld (int sigsig)
{
AttacherPanic = 1;
SIGRETURN;
@@ -402,7 +402,7 @@ AttacherChld SIGDEFARG
#endif
static sigret_t
-AttacherSigAlarm SIGDEFARG
+AttacherSigAlarm (int sigsig)
{
#ifdef DEBUG
static int tick_cnt = 0;
@@ -417,7 +417,7 @@ AttacherSigAlarm SIGDEFARG
* we forward SIGINT to the poor backend
*/
static sigret_t
-AttacherSigInt SIGDEFARG
+AttacherSigInt (int sigsig)
{
signal(SIGINT, AttacherSigInt);
Kill(MasterPid, SIGINT);
@@ -430,7 +430,7 @@ AttacherSigInt SIGDEFARG
*/
sigret_t
-AttacherFinit SIGDEFARG
+AttacherFinit (int sigsig)
{
struct stat statb;
struct msg m;
@@ -466,7 +466,7 @@ AttacherFinit SIGDEFARG
}
static sigret_t
-AttacherFinitBye SIGDEFARG
+AttacherFinitBye (int sigsig)
{
int ppid;
debug("AttacherFintBye()\n");
@@ -487,7 +487,7 @@ AttacherFinitBye SIGDEFARG
#if defined(DEBUG) && defined(SIG_NODEBUG)
static sigret_t
-AttacherNoDebug SIGDEFARG
+AttacherNoDebug (int sigsig)
{
debug("AttacherNoDebug()\n");
signal(SIG_NODEBUG, AttacherNoDebug);
@@ -505,7 +505,7 @@ AttacherNoDebug SIGDEFARG
static int SuspendPlease;
static sigret_t
-SigStop SIGDEFARG
+SigStop (int sigsig)
{
debug("SigStop()\n");
SuspendPlease = 1;
@@ -515,7 +515,7 @@ SigStop SIGDEFARG
static int LockPlease;
static sigret_t
-DoLock SIGDEFARG
+DoLock (int sigsig)
{
# ifdef SYSVSIGS
signal(SIG_LOCK, DoLock);
@@ -529,7 +529,7 @@ DoLock SIGDEFARG
static int SigWinchPlease;
static sigret_t
-AttacherWinch SIGDEFARG
+AttacherWinch (int sigsig)
{
debug("AttacherWinch()\n");
SigWinchPlease = 1;
@@ -632,7 +632,7 @@ Attacher()
static char LockEnd[] = "Welcome back to screen !!\n";
static sigret_t
-LockHup SIGDEFARG
+LockHup (int sigsig)
{
int ppid = getppid();
if (setgid(real_gid))
@@ -649,7 +649,7 @@ LockTerminal()
{
char *prg;
int sig, pid;
- sigret_t (*sigs[NSIG])SIGPROTOARG;
+ sigret_t (*sigs[NSIG])(int);
for (sig = 1; sig < NSIG; sig++)
sigs[sig] = signal(sig, sig == SIGCHLD ? SIG_DFL : SIG_IGN);
@@ -726,7 +726,7 @@ LockTerminal()
/* reset signals */
for (sig = 1; sig < NSIG; sig++)
{
- if (sigs[sig] != (sigret_t(*)SIGPROTOARG) -1)
+ if (sigs[sig] != (sigret_t(*)(int)) -1)
signal(sig, sigs[sig]);
}
} /* LockTerminal */
@@ -871,7 +871,7 @@ screen_builtin_lck()
errno = 0;
if ((cp1 = getpass(message)) == NULL)
{
- AttacherFinit(SIGARG);
+ AttacherFinit(0);
/* NOTREACHED */
}
if (using_pam)
@@ -880,7 +880,7 @@ screen_builtin_lck()
PAM_conversation.appdata_ptr = cp1;
pam_error = pam_start("screen", ppp->pw_name, &PAM_conversation, &pamh);
if (pam_error != PAM_SUCCESS)
- AttacherFinit(SIGARG); /* goodbye */
+ AttacherFinit(0); /* goodbye */
if (strncmp(attach_tty, "/dev/", 5) == 0)
tty_name = attach_tty + 5;
@@ -888,7 +888,7 @@ screen_builtin_lck()
tty_name = attach_tty;
pam_error = pam_set_item(pamh, PAM_TTY, tty_name);
if (pam_error != PAM_SUCCESS)
- AttacherFinit(SIGARG); /* goodbye */
+ AttacherFinit(0); /* goodbye */
pam_error = pam_authenticate(pamh, 0);
pam_end(pamh, pam_error);
diff --git a/src/extern.h b/src/extern.h
index 159a6cb..e3a3f5c 100644
--- a/src/extern.h
+++ b/src/extern.h
@@ -34,7 +34,7 @@
/* screen.c */
extern int main (int, char **);
-extern sigret_t SigHup SIGPROTOARG;
+extern sigret_t SigHup (int);
extern void eexit (int) __attribute__((__noreturn__));
extern void Detach (int);
extern void Hangup (void);
@@ -222,7 +222,7 @@ extern void FreeTransTable (void);
/* attacher.c */
extern int Attach (int);
extern void Attacher (void);
-extern sigret_t AttacherFinit SIGPROTOARG;
+extern sigret_t AttacherFinit (int);
extern void SendCmdMessage (char *, char *, char **, int);
/* display.c */
@@ -334,7 +334,7 @@ extern int UserContext (void);
extern void UserReturn (int);
extern int UserStatus (void);
#if defined(POSIX) || defined(hpux)
-extern void (*xsignal (int, void (*)SIGPROTOARG)) SIGPROTOARG;
+extern void (*xsignal (int, void (*)(int))) (int);
#endif
#ifndef HAVE_RENAME
extern int rename (char *, char *);
diff --git a/src/misc.c b/src/misc.c
index 3521f8a..d134045 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -175,12 +175,12 @@ stripdev(char *nam)
#ifdef POSIX
sigret_t (*xsignal(sig, func))
# ifndef __APPLE__
- SIGPROTOARG
+ (int)
# else
()
# endif
int sig;
-sigret_t (*func) SIGPROTOARG;
+sigret_t (*func) (int);
{
struct sigaction osa, sa;
sa.sa_handler = func;
@@ -191,7 +191,7 @@ sigret_t (*func) SIGPROTOARG;
sa.sa_flags = 0;
#endif
if (sigaction(sig, &sa, &osa))
- return (sigret_t (*)SIGPROTOARG)-1;
+ return (sigret_t (*)(int))-1;
return osa.sa_handler;
}
@@ -201,9 +201,9 @@ sigret_t (*func) SIGPROTOARG;
* hpux has berkeley signal semantics if we use sigvector,
* but not, if we use signal, so we define our own signal() routine.
*/
-void (*xsignal(sig, func)) SIGPROTOARG
+void (*xsignal(sig, func)) (int)
int sig;
-void (*func) SIGPROTOARG;
+void (*func) (int);
{
struct sigvec osv, sv;
@@ -211,7 +211,7 @@ void (*func) SIGPROTOARG;
sv.sv_mask = sigmask(sig);
sv.sv_flags = SV_BSDSIG;
if (sigvector(sig, &sv, &osv) < 0)
- return (void (*)SIGPROTOARG)(BADSIG);
+ return (void (*)(int))(BADSIG);
return osv.sv_handler;
}
# endif /* hpux */
@@ -344,7 +344,7 @@ closeallfiles(int except)
#ifndef USE_SETEUID
static int UserPID;
-static sigret_t (*Usersigcld)SIGPROTOARG;
+static sigret_t (*Usersigcld)(int);
#endif
static int UserSTAT;
diff --git a/src/os.h b/src/os.h
index 70bafde..d525677 100644
--- a/src/os.h
+++ b/src/os.h
@@ -376,21 +376,6 @@ extern int errno;
# define sigret_t int
#endif
-/* Geeeee, reverse it? */
-#if defined(SVR4) || (defined(SYSV) && defined(ISC)) || defined(_AIX) || defined(linux) || defined(ultrix) || defined(__386BSD__) || defined(__bsdi__) || defined(POSIX) || defined(NeXT)
-# define SIGHASARG
-#endif
-
-#ifdef SIGHASARG
-# define SIGPROTOARG (int)
-# define SIGDEFARG (sigsig) int sigsig;
-# define SIGARG 0
-#else
-# define SIGPROTOARG (void)
-# define SIGDEFARG ()
-# define SIGARG
-#endif
-
#ifndef SIGCHLD
#define SIGCHLD SIGCLD
#endif
diff --git a/src/pty.c b/src/pty.c
index 2c90f5e..2b7d955 100644
--- a/src/pty.c
+++ b/src/pty.c
@@ -192,7 +192,7 @@ OpenPTY(char **ttyn)
{
int f;
char *name, *_getpty();
- sigret_t (*sigcld)SIGPROTOARG;
+ sigret_t (*sigcld)(int);
/*
* SIGCHLD set to SIG_DFL for _getpty() because it may fork() and
@@ -248,7 +248,7 @@ OpenPTY(char **ttyn)
#if defined(HAVE_GETPT) && defined(linux)
int getpt (void);
#endif
- sigret_t (*sigcld)SIGPROTOARG;
+ sigret_t (*sigcld)(int);
strncpy(PtyName, "/dev/ptmx", 32);
#if defined(HAVE_GETPT) && (defined(linux) || defined(__GLIBC__))
diff --git a/src/screen.c b/src/screen.c
index 5313119..9cf46aa 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -109,10 +109,10 @@ struct backtick;
static struct passwd *getpwbyname (char *, struct passwd *);
static void SigChldHandler (void);
-static sigret_t SigChld SIGPROTOARG;
-static sigret_t SigInt SIGPROTOARG;
-static sigret_t CoreDump SIGPROTOARG;
-static sigret_t FinitHandler SIGPROTOARG;
+static sigret_t SigChld (int);
+static sigret_t SigInt (int);
+static sigret_t CoreDump (int);
+static sigret_t FinitHandler (int);
static void DoWait (void);
static void serv_read_fn (struct event *, char *);
static void serv_select_fn (struct event *, char *);
@@ -1471,7 +1471,7 @@ SigChldHandler()
}
static sigret_t
-SigChld SIGDEFARG
+SigChld (int sigsig)
{
debug("SigChld()\n");
GotSigChld = 1;
@@ -1479,7 +1479,7 @@ SigChld SIGDEFARG
}
sigret_t
-SigHup SIGDEFARG
+SigHup (int sigsig)
{
/* Hangup all displays */
while ((display = displays) != 0)
@@ -1493,7 +1493,7 @@ SigHup SIGDEFARG
* if fore is valid.
*/
static sigret_t
-SigInt SIGDEFARG
+SigInt (int sigsig)
{
#if HAZARDOUS
char ibuf;
@@ -1518,7 +1518,7 @@ SigInt SIGDEFARG
}
static sigret_t
-CoreDump SIGDEFARG
+CoreDump (int sigsig)
{
/* if running with s-bit, we must reset the s-bit, so that we get a
* core file anyway.
@@ -1669,7 +1669,7 @@ DoWait()
static sigret_t
-FinitHandler SIGDEFARG
+FinitHandler (int sigsig)
{
#ifdef SIGHASARG
debug1("FinitHandler called, sig %d.\n", sigsig);
diff --git a/src/tty.sh b/src/tty.sh
index 67e51d8..fb3b63d 100644
--- a/src/tty.sh
+++ b/src/tty.sh
@@ -100,7 +100,7 @@ static void consredir_readev_fn (struct event *, char *);
int separate_sids = 1;
static void DoSendBreak (int, int, int);
-static sigret_t SigAlrmDummy SIGPROTOARG;
+static sigret_t SigAlrmDummy (int);
/* Frank Schulz (fschulz@pyramid.com):
@@ -127,7 +127,7 @@ static sigret_t SigAlrmDummy SIGPROTOARG;
static sigret_t
-SigAlrmDummy SIGDEFARG
+SigAlrmDummy (int sigsig)
{
debug("SigAlrmDummy()\n");
SIGRETURN;
@@ -144,7 +144,7 @@ char *line, *opt;
{
int f;
struct mode Mode;
- sigret_t (*sigalrm)SIGPROTOARG;
+ sigret_t (*sigalrm)(int);
sigalrm = signal(SIGALRM, SigAlrmDummy);
alarm(2);
@@ -969,7 +969,7 @@ SendBreak(wp, n, closeopen)
struct win *wp;
int n, closeopen;
{
- sigret_t (*sigalrm)SIGPROTOARG;
+ sigret_t (*sigalrm)(int);
#ifdef BUILTIN_TELNET
if (wp->w_type == W_TYPE_TELNET)