Fix bogus casts
diff --git a/ash/trap.c b/ash/trap.c
index ce0cdcd..3e550d2 100644
--- a/ash/trap.c
+++ b/ash/trap.c
@@ -140,7 +140,7 @@
* out what it should be set to.
*/
-int
+__sighandler_t
setsignal(signo) {
int action;
__sighandler_t sigact;
@@ -188,7 +188,7 @@
* There is a race condition here if action is not S_IGN.
* A signal can be ignored that shouldn't be.
*/
- if ((int)(sigact = bsd_signal(signo, SIG_IGN)) == -1)
+ if ((sigact = bsd_signal(signo, SIG_IGN)) == SIG_ERR)
error("Signal system call failed");
if (sigact == SIG_IGN) {
*t = S_HARD_IGN;
@@ -204,7 +204,7 @@
case S_IGN: sigact = SIG_IGN; break;
}
*t = action;
- return (int)bsd_signal(signo, sigact);
+ return bsd_signal(signo, sigact);
}
diff --git a/ash/trap.h b/ash/trap.h
index cdb604b..c2ad188 100644
--- a/ash/trap.h
+++ b/ash/trap.h
@@ -41,18 +41,9 @@
extern int pendingsigs;
-#ifdef __STDC__
void clear_traps(void);
-int setsignal(int);
+__sighandler_t setsignal(int);
void ignoresig(int);
void dotrap(void);
void setinteractive(int);
void exitshell(int);
-#else
-void clear_traps();
-int setsignal();
-void ignoresig();
-void dotrap();
-void setinteractive();
-void exitshell();
-#endif