summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmadeusz Sławiński (amade) <amade@asmblr.net>2011-04-10 00:03:25 +0200
committerAmadeusz Sławiński <amade@asmblr.net>2014-07-24 11:50:46 +0200
commit9c56a148c0c6c8038a48cb5396d1643962f3c0b9 (patch)
treedcdfbbb87ac2edda0375a2a8f27dd28d3870ebec
parent7c70d07aef0f245ee01b38a1ef9a9e3daeae2f58 (diff)
downloadscreen-9c56a148c0c6c8038a48cb5396d1643962f3c0b9.tar.gz
more work around signals
-rw-r--r--src/attacher.c66
-rw-r--r--src/extern.h4
-rw-r--r--src/misc.c8
-rw-r--r--src/pty.c4
-rw-r--r--src/screen.c28
-rw-r--r--src/tty.sh10
6 files changed, 60 insertions, 60 deletions
diff --git a/src/attacher.c b/src/attacher.c
index c8aa746..a9d611b 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 (int);
+static void AttacherSigInt (int);
#if defined(SIGWINCH) && defined(TIOCGWINSZ)
-static sigret_t AttacherWinch (int);
+static void AttacherWinch (int);
#endif
-static sigret_t DoLock (int);
+static void DoLock (int);
static void LockTerminal (void);
-static sigret_t LockHup (int);
+static void LockHup (int);
static void screen_builtin_lck (void);
#ifdef DEBUG
-static sigret_t AttacherChld (int);
+static void AttacherChld (int);
#endif
-static sigret_t AttachSigCont (int);
+static void AttachSigCont (int);
# ifndef USE_SETEUID
@@ -59,28 +59,28 @@ static int multipipe[2];
static int ContinuePlease;
-static sigret_t
+static void
AttachSigCont (int sigsig)
{
debug("SigCont()\n");
ContinuePlease = 1;
- SIGRETURN;
+ return;
}
static int QueryResult;
-static sigret_t
+static void
QueryResultSuccess (int sigsig)
{
QueryResult = 1;
- SIGRETURN;
+ return;
}
-static sigret_t
+static void
QueryResultFail (int sigsig)
{
QueryResult = 2;
- SIGRETURN;
+ return;
}
/*
@@ -393,15 +393,15 @@ Attach(int how)
static int AttacherPanic = 0;
#ifdef DEBUG
-static sigret_t
+static void
AttacherChld (int sigsig)
{
AttacherPanic = 1;
- SIGRETURN;
+ return;
}
#endif
-static sigret_t
+static void
AttacherSigAlarm (int sigsig)
{
#ifdef DEBUG
@@ -409,19 +409,19 @@ AttacherSigAlarm (int sigsig)
if ((tick_cnt = (tick_cnt + 1) % 4) == 0)
debug("tick\n");
#endif
- SIGRETURN;
+ return;
}
/*
* the frontend's Interrupt handler
* we forward SIGINT to the poor backend
*/
-static sigret_t
+static void
AttacherSigInt (int sigsig)
{
signal(SIGINT, AttacherSigInt);
Kill(MasterPid, SIGINT);
- SIGRETURN;
+ return;
}
/*
@@ -429,7 +429,7 @@ AttacherSigInt (int sigsig)
* check if the backend is already detached.
*/
-sigret_t
+void
AttacherFinit (int sigsig)
{
struct stat statb;
@@ -462,10 +462,10 @@ AttacherFinit (int sigsig)
chmod(attach_tty, tty_oldmode);
}
exit(0);
- SIGRETURN;
+ return;
}
-static sigret_t
+static void
AttacherFinitBye (int sigsig)
{
int ppid;
@@ -482,11 +482,11 @@ AttacherFinitBye (int sigsig)
if ((ppid = getppid()) > 1)
Kill(ppid, SIGHUP); /* carefully say good bye. jw. */
exit(0);
- SIGRETURN;
+ return;
}
#if defined(DEBUG) && defined(SIG_NODEBUG)
-static sigret_t
+static void
AttacherNoDebug (int sigsig)
{
debug("AttacherNoDebug()\n");
@@ -498,23 +498,23 @@ AttacherNoDebug (int sigsig)
fclose(dfp);
dfp = NULL;
}
- SIGRETURN;
+ return;
}
#endif /* SIG_NODEBUG */
static int SuspendPlease;
-static sigret_t
+static void
SigStop (int sigsig)
{
debug("SigStop()\n");
SuspendPlease = 1;
- SIGRETURN;
+ return;
}
static int LockPlease;
-static sigret_t
+static void
DoLock (int sigsig)
{
# ifdef SYSVSIGS
@@ -522,18 +522,18 @@ DoLock (int sigsig)
# endif
debug("DoLock()\n");
LockPlease = 1;
- SIGRETURN;
+ return;
}
#if defined(SIGWINCH) && defined(TIOCGWINSZ)
static int SigWinchPlease;
-static sigret_t
+static void
AttacherWinch (int sigsig)
{
debug("AttacherWinch()\n");
SigWinchPlease = 1;
- SIGRETURN;
+ return;
}
#endif
@@ -631,7 +631,7 @@ Attacher()
static char LockEnd[] = "Welcome back to screen !!\n";
-static sigret_t
+static void
LockHup (int sigsig)
{
int ppid = getppid();
@@ -649,7 +649,7 @@ LockTerminal()
{
char *prg;
int sig, pid;
- sigret_t (*sigs[NSIG])(int);
+ void(*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(*)(int)) -1)
+ if (sigs[sig] != (void(*)(int)) -1)
signal(sig, sigs[sig]);
}
} /* LockTerminal */
diff --git a/src/extern.h b/src/extern.h
index e3a3f5c..f6132cd 100644
--- a/src/extern.h
+++ b/src/extern.h
@@ -34,7 +34,7 @@
/* screen.c */
extern int main (int, char **);
-extern sigret_t SigHup (int);
+extern void 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 (int);
+extern void AttacherFinit (int);
extern void SendCmdMessage (char *, char *, char **, int);
/* display.c */
diff --git a/src/misc.c b/src/misc.c
index d134045..e63d7fd 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -173,14 +173,14 @@ stripdev(char *nam)
*/
#ifdef POSIX
-sigret_t (*xsignal(sig, func))
+void (*xsignal(sig, func))
# ifndef __APPLE__
(int)
# else
()
# endif
int sig;
-sigret_t (*func) (int);
+void (*func) (int);
{
struct sigaction osa, sa;
sa.sa_handler = func;
@@ -191,7 +191,7 @@ sigret_t (*func) (int);
sa.sa_flags = 0;
#endif
if (sigaction(sig, &sa, &osa))
- return (sigret_t (*)(int))-1;
+ return (void (*)(int))-1;
return osa.sa_handler;
}
@@ -344,7 +344,7 @@ closeallfiles(int except)
#ifndef USE_SETEUID
static int UserPID;
-static sigret_t (*Usersigcld)(int);
+static void (*Usersigcld)(int);
#endif
static int UserSTAT;
diff --git a/src/pty.c b/src/pty.c
index 2b7d955..53b03d8 100644
--- a/src/pty.c
+++ b/src/pty.c
@@ -192,7 +192,7 @@ OpenPTY(char **ttyn)
{
int f;
char *name, *_getpty();
- sigret_t (*sigcld)(int);
+ void (*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)(int);
+ void (*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 ee9cf0c..2c6accd 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 (int);
-static sigret_t SigInt (int);
-static sigret_t CoreDump (int);
-static sigret_t FinitHandler (int);
+static void SigChld (int);
+static void SigInt (int);
+static void CoreDump (int);
+static void FinitHandler (int);
static void DoWait (void);
static void serv_read_fn (struct event *, char *);
static void serv_select_fn (struct event *, char *);
@@ -1470,21 +1470,21 @@ SigChldHandler()
debug2("SigChldHandler: stat '%s' o.k. (%03o)\n", SockPath, (int)st.st_mode);
}
-static sigret_t
+static void
SigChld (int sigsig)
{
debug("SigChld()\n");
GotSigChld = 1;
- SIGRETURN;
+ return;
}
-sigret_t
+void
SigHup (int sigsig)
{
/* Hangup all displays */
while ((display = displays) != 0)
Hangup();
- SIGRETURN;
+ return;
}
/*
@@ -1492,16 +1492,16 @@ SigHup (int sigsig)
* we cannot insert the intrc directly, as we never know
* if fore is valid.
*/
-static sigret_t
+static void
SigInt (int sigsig)
{
signal(SIGINT, SigInt);
debug("SigInt() careful\n");
InterruptPlease = 1;
- SIGRETURN;
+ return;
}
-static sigret_t
+static void
CoreDump (int sigsig)
{
/* if running with s-bit, we must reset the s-bit, so that we get a
@@ -1553,7 +1553,7 @@ CoreDump (int sigsig)
}
else
abort();
- SIGRETURN;
+ return;
}
static void
@@ -1652,7 +1652,7 @@ DoWait()
}
-static sigret_t
+static void
FinitHandler (int sigsig)
{
#ifdef SIGHASARG
@@ -1661,7 +1661,7 @@ FinitHandler (int sigsig)
debug("FinitHandler called.\n");
#endif
Finit(1);
- SIGRETURN;
+ return;
}
void
diff --git a/src/tty.sh b/src/tty.sh
index fb3b63d..5550cce 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 (int);
+static void SigAlrmDummy (int);
/* Frank Schulz (fschulz@pyramid.com):
@@ -126,11 +126,11 @@ static sigret_t SigAlrmDummy (int);
#endif
-static sigret_t
+static void
SigAlrmDummy (int sigsig)
{
debug("SigAlrmDummy()\n");
- SIGRETURN;
+ return;
}
/*
@@ -144,7 +144,7 @@ char *line, *opt;
{
int f;
struct mode Mode;
- sigret_t (*sigalrm)(int);
+ void (*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)(int);
+ void (*sigalrm)(int);
#ifdef BUILTIN_TELNET
if (wp->w_type == W_TYPE_TELNET)