Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make make(1): add typedef for signal handler



details:   https://anonhg.NetBSD.org/src/rev/fc73103a394d
branches:  trunk
changeset: 976085:fc73103a394d
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Sep 12 16:46:24 2020 +0000

description:
make(1): add typedef for signal handler

Without this typedef, both the declaration and the definition of
bmake_signal were as unreadable as the declaration in the signal(3)
manual page.

diffstat:

 usr.bin/make/nonints.h |   5 +++--
 usr.bin/make/util.c    |  10 +++++-----
 2 files changed, 8 insertions(+), 7 deletions(-)

diffs (50 lines):

diff -r 626cd72ca766 -r fc73103a394d usr.bin/make/nonints.h
--- a/usr.bin/make/nonints.h    Sat Sep 12 16:44:41 2020 +0000
+++ b/usr.bin/make/nonints.h    Sat Sep 12 16:46:24 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nonints.h,v 1.113 2020/09/12 16:38:19 rillig Exp $     */
+/*     $NetBSD: nonints.h,v 1.114 2020/09/12 16:46:24 rillig Exp $     */
 
 /*-
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -225,4 +225,5 @@
 void Var_UnExport(const char *);
 
 /* util.c */
-void (*bmake_signal(int, void (*)(int)))(int);
+typedef void (*SignalProc)(int);
+SignalProc bmake_signal(int, SignalProc);
diff -r 626cd72ca766 -r fc73103a394d usr.bin/make/util.c
--- a/usr.bin/make/util.c       Sat Sep 12 16:44:41 2020 +0000
+++ b/usr.bin/make/util.c       Sat Sep 12 16:46:24 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: util.c,v 1.58 2020/08/01 14:47:49 rillig Exp $ */
+/*     $NetBSD: util.c,v 1.59 2020/09/12 16:46:24 rillig Exp $ */
 
 /*
  * Missing stuff from OS's
@@ -8,11 +8,11 @@
 #endif
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: util.c,v 1.58 2020/08/01 14:47:49 rillig Exp $";
+static char rcsid[] = "$NetBSD: util.c,v 1.59 2020/09/12 16:46:24 rillig Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: util.c,v 1.58 2020/08/01 14:47:49 rillig Exp $");
+__RCSID("$NetBSD: util.c,v 1.59 2020/09/12 16:46:24 rillig Exp $");
 #endif
 #endif
 
@@ -339,8 +339,8 @@
 #endif /* __hpux */
 
 /* force posix signals */
-void (*
-bmake_signal(int s, void (*a)(int)))(int)
+SignalProc
+bmake_signal(int s, SignalProc a)
 {
     struct sigaction sa, osa;
 



Home | Main Index | Thread Index | Old Index