Modernize: use sigaction() whenever possible. Remove uses of common.

bsd_signal() may not be defined, and there is really no reason to even
try to use it if sigaction() is avaiable; using sigaction() guarantees
the semantics we really want.

Replace uses of common variables with explicit instantiation and
extern declarations in a header file.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
H. Peter Anvin 2024-05-29 15:34:57 -07:00
parent 9c0908a778
commit 1f4b33a1f7
9 changed files with 64 additions and 42 deletions

View file

@ -1,6 +1,6 @@
/* -*- c -*- ------------------------------------------------------------- *
*
* Copyright 2001-2006 H. Peter Anvin - All Rights Reserved
* Copyright 2001-2024 H. Peter Anvin - All Rights Reserved
*
* This program is free software available under the same license
* as the "OpenBSD" operating system, distributed at
@ -279,9 +279,14 @@ typedef int socklen_t;
void *xmalloc(size_t);
char *xstrdup(const char *);
#ifndef HAVE_BSD_SIGNAL
void (*bsd_signal(int, void (*)(int))) (int);
#ifndef HAVE_SIGHANDLER_T
typedef void (*sighandler_t)(int);
#endif
#ifndef SIG_ERR
#define SIG_ERR NULL
#endif
sighandler_t tftp_signal(int, sighandler_t);
#ifndef HAVE_DUP2
int dup2(int, int);
#endif