diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2004-12-28 21:11:23 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2004-12-28 21:11:23 +0000 |
commit | a1c38d31c605797a046f8d6788f734e733a8be06 (patch) | |
tree | c5f04511be589fb2aa270c50e06157a9f47e5b1e | |
parent | 4861b3654fe0c5c6d961e339b28c6a7e31ebd826 (diff) |
ansi. No binary change.
-rw-r--r-- | bin/ksh/c_sh.c | 11 | ||||
-rw-r--r-- | bin/ksh/trap.c | 50 |
2 files changed, 21 insertions, 40 deletions
diff --git a/bin/ksh/c_sh.c b/bin/ksh/c_sh.c index d78624e0030..b76cc0af525 100644 --- a/bin/ksh/c_sh.c +++ b/bin/ksh/c_sh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: c_sh.c,v 1.26 2004/12/22 18:57:28 otto Exp $ */ +/* $OpenBSD: c_sh.c,v 1.27 2004/12/28 21:11:21 jsg Exp $ */ /* * built-in Bourne commands @@ -670,13 +670,8 @@ c_unset(char **wp) } static void -p_time(shf, posix, tv, width, prefix, suffix) - struct shf *shf; - int posix; - struct timeval *tv; - int width; - char *prefix; - char *suffix; +p_time(struct shf *shf, int posix, struct timeval *tv, int width, char *prefix, + char *suffix) { if (posix) shf_fprintf(shf, "%s%*ld.%02ld%s", prefix ? prefix : "", diff --git a/bin/ksh/trap.c b/bin/ksh/trap.c index e01ceb475d0..57a62e19309 100644 --- a/bin/ksh/trap.c +++ b/bin/ksh/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.19 2004/12/22 17:47:03 millert Exp $ */ +/* $OpenBSD: trap.c,v 1.20 2004/12/28 21:11:22 jsg Exp $ */ /* * signal handling @@ -11,7 +11,7 @@ Trap sigtraps[NSIG + 1]; static struct sigaction Sigact_ign, Sigact_trap; void -inittraps() +inittraps(void) { int i; @@ -50,7 +50,7 @@ inittraps() static void alarm_catcher(int sig); void -alarm_init() +alarm_init(void) { sigtraps[SIGALRM].flags |= TF_SHELL_USES; setsig(&sigtraps[SIGALRM], alarm_catcher, @@ -58,8 +58,7 @@ alarm_init() } static void -alarm_catcher(sig) - int sig; +alarm_catcher(int sig) { int errno_ = errno; @@ -76,9 +75,7 @@ alarm_catcher(sig) } Trap * -gettrap(name, igncase) - const char *name; - int igncase; +gettrap(const char *name, int igncase) { int i; Trap *p; @@ -112,8 +109,7 @@ gettrap(name, igncase) * trap signal handler */ void -trapsig(i) - int i; +trapsig(int i) { Trap *p = &sigtraps[i]; int errno_ = errno; @@ -134,7 +130,7 @@ trapsig(i) * work if user has trapped SIGINT. */ void -intrcheck() +intrcheck(void) { if (intrsig) runtraps(TF_DFL_INTR|TF_FATAL); @@ -144,7 +140,7 @@ intrcheck() * termination has been received. */ int -fatal_trap_check() +fatal_trap_check(void) { int i; Trap *p; @@ -162,7 +158,7 @@ fatal_trap_check() * is set. */ int -trap_pending() +trap_pending(void) { int i; Trap *p; @@ -180,8 +176,7 @@ trap_pending() * can interrupt commands. */ void -runtraps(flag) - int flag; +runtraps(int flag) { int i; Trap *p; @@ -208,8 +203,7 @@ runtraps(flag) } void -runtrap(p) - Trap *p; +runtrap(Trap *p) { int i = p->signal; char *trapstr = p->trap; @@ -255,7 +249,7 @@ runtrap(p) /* clear pending traps and reset user's trap handlers; used after fork(2) */ void -cleartraps() +cleartraps(void) { int i; Trap *p; @@ -272,7 +266,7 @@ cleartraps() /* restore signals just before an exec(2) */ void -restoresigs() +restoresigs(void) { int i; Trap *p; @@ -284,9 +278,7 @@ restoresigs() } void -settrap(p, s) - Trap *p; - char *s; +settrap(Trap *p, char *s) { sig_t f; @@ -322,7 +314,7 @@ settrap(p, s) * kill shell (unless user catches it and exits) */ int -block_pipe() +block_pipe(void) { int restore_dfl = 0; Trap *p = &sigtraps[SIGPIPE]; @@ -340,8 +332,7 @@ block_pipe() /* Called by c_print() to undo whatever block_pipe() did */ void -restore_pipe(restore_dfl) - int restore_dfl; +restore_pipe(int restore_dfl) { if (restore_dfl) setsig(&sigtraps[SIGPIPE], SIG_DFL, SS_RESTORE_CURR); @@ -352,10 +343,7 @@ restore_pipe(restore_dfl) * FTALKING. */ int -setsig(p, f, flags) - Trap *p; - sig_t f; - int flags; +setsig(Trap *p, sig_t f, int flags) { struct sigaction sigact; @@ -406,9 +394,7 @@ setsig(p, f, flags) /* control what signal is set to before an exec() */ void -setexecsig(p, restore) - Trap *p; - int restore; +setexecsig(Trap *p, int restore) { /* XXX debugging */ if (!(p->flags & (TF_ORIG_IGN|TF_ORIG_DFL))) |