Browse Source

signal: cleanup, include only headers that are needed

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Peter S. Mazinger 13 years ago
parent
commit
7049cfee24

+ 1 - 1
include/signal.h

@@ -259,7 +259,6 @@ extern int sigemptyset (sigset_t *__set) __THROW __nonnull ((1));
 
 /* Set all signals in SET.  */
 extern int sigfillset (sigset_t *__set) __THROW __nonnull ((1));
-libc_hidden_proto(sigfillset)
 
 /* Add SIGNO to SET.  */
 extern int sigaddset (sigset_t *__set, int __signo) __THROW __nonnull ((1));
@@ -484,6 +483,7 @@ extern int __libc_current_sigrtmin (void) __THROW;
 extern int __libc_current_sigrtmax (void) __THROW;
 
 #ifdef _LIBC
+extern sigset_t _sigintr attribute_hidden;
 /* simplified version without parameter checking */
 # include <string.h>
 # undef __sigemptyset

+ 0 - 1
libc/signal/allocrtsig.c

@@ -20,7 +20,6 @@
 
 #include <features.h>
 #include <signal.h>
-#include <sys/types.h>
 #include <sys/syscall.h>
 
 /* Only enable rt signals when it is supported at compile time */

+ 0 - 1
libc/signal/killpg.c

@@ -19,7 +19,6 @@
 #include <errno.h>
 #include <signal.h>
 
-
 /* Send SIG to all processes in process group PGRP.
    If PGRP is zero, send SIG to all processes in
    the current process's process group.  */

+ 0 - 2
libc/signal/raise.c

@@ -3,9 +3,7 @@
  */
 
 #include <unistd.h>
-#include <string.h>
 #include <signal.h>
-#include <sys/types.h>
 
 int raise(int signo)
 {

+ 3 - 5
libc/signal/sigaction.c

@@ -16,14 +16,9 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#include <features.h>
-#include <errno.h>
 #include <signal.h>
-#include <string.h>
 #include <sys/syscall.h>
 
-#include <bits/kernel_sigaction.h>
-
 #if defined __NR_rt_sigaction
 
 /* If ACT is not NULL, change the action for SIG to *ACT.
@@ -42,6 +37,9 @@ __libc_sigaction(int sig, const struct sigaction *act, struct sigaction *oact)
 }
 
 #else
+# define __need_NULL
+# include <stddef.h>
+# include <bits/kernel_sigaction.h>
 
 /* If ACT is not NULL, change the action for SIG to *ACT.
    If OACT is not NULL, put the old action for SIG in *OACT.  */

+ 4 - 1
libc/signal/sigaddset.c

@@ -16,7 +16,10 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#include "sigsetops.h"
+#define __need_NULL
+#include <stddef.h>
+#include <signal.h>
+#include <errno.h>
 
 /* Add SIGNO to SET.  */
 int

+ 0 - 1
libc/signal/sigblock.c

@@ -17,7 +17,6 @@
    02111-1307 USA.  */
 
 #define __UCLIBC_HIDE_DEPRECATED__
-#include <errno.h>
 #include <signal.h>
 
 #include "sigset-cvt-mask.h"

+ 4 - 1
libc/signal/sigdelset.c

@@ -16,7 +16,10 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#include "sigsetops.h"
+#define __need_NULL
+#include <stddef.h>
+#include <signal.h>
+#include <errno.h>
 
 /* Add SIGNO to SET.  */
 int sigdelset (sigset_t *set, int signo)

+ 5 - 2
libc/signal/sigempty.c

@@ -16,9 +16,12 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#include <errno.h>
 #include <signal.h>
-#include <string.h>
+#if 0
+#define __need_NULL
+#include <stddef.h>
+#include <errno.h>
+#endif
 
 /* Clear all signals from SET.  */
 int sigemptyset (sigset_t *set)

+ 5 - 4
libc/signal/sigfillset.c

@@ -16,10 +16,12 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#include <errno.h>
 #include <signal.h>
-#include <string.h>
-
+#if 0
+#define __need_NULL
+#include <stddef.h>
+#include <errno.h>
+#endif
 
 /* Set all signals in SET.  */
 int
@@ -46,4 +48,3 @@ sigfillset (sigset_t *set)
 
   return 0;
 }
-libc_hidden_def(sigfillset)

+ 0 - 1
libc/signal/siggetmask.c

@@ -20,7 +20,6 @@
 #define __UCLIBC_HIDE_DEPRECATED__
 #include <signal.h>
 
-
 int
 siggetmask (void)
 {

+ 0 - 1
libc/signal/sighold.c

@@ -22,7 +22,6 @@
 #include <stddef.h>
 #include <signal.h>
 
-
 int sighold (int sig)
 {
   sigset_t set;

+ 1 - 3
libc/signal/sigignore.c

@@ -18,12 +18,10 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#include <errno.h>
 #define __need_NULL
 #include <stddef.h>
 #include <signal.h>
-#include <string.h>	/* For the real memset prototype.  */
-
+#include <string.h>
 
 int sigignore (int sig)
 {

+ 4 - 4
libc/signal/sigintr.c

@@ -16,16 +16,16 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#include <stddef.h>
 #include <signal.h>
-#include <errno.h>
-
 
 /* If INTERRUPT is nonzero, make signal SIG interrupt system calls
    (causing them to fail with EINTR); if INTERRUPT is zero, make system
    calls be restarted after signal SIG.  */
 #ifdef SA_RESTART
-extern sigset_t _sigintr attribute_hidden;	/* Defined in signal.c.  */
+# define __need_NULL
+# include <stddef.h>
+#else
+# include <errno.h>
 #endif
 
 int siginterrupt (int sig, int interrupt)

+ 4 - 1
libc/signal/sigismem.c

@@ -16,7 +16,10 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#include "sigsetops.h"
+#define __need_NULL
+#include <stddef.h>
+#include <signal.h>
+#include <errno.h>
 
 /* Return 1 if SIGNO is in SET, 0 if not.  */
 int sigismember (const sigset_t *set, int signo)

+ 1 - 1
libc/signal/sigjmp.c

@@ -16,11 +16,11 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#define __need_NULL
 #include <stddef.h>
 #include <setjmp.h>
 #include <signal.h>
 
-
 /* This function is called by the `sigsetjmp' macro
    before doing a `__setjmp' on ENV[0].__jmpbuf.
    Always return zero.  */

+ 1 - 1
libc/signal/signal.c

@@ -22,7 +22,7 @@
 #include <signal.h>
 #include <string.h>	/* For the real memset prototype.  */
 
-sigset_t _sigintr attribute_hidden;		/* Set by siginterrupt.  */
+sigset_t _sigintr;	/* Set by siginterrupt.  */
 
 /* Set the handler for the signal SIG to HANDLER,
    returning the old handler, or SIG_ERR on error.  */

+ 2 - 1
libc/signal/sigpause.c

@@ -22,7 +22,8 @@
 #include <errno.h>
 #define __FAVOR_BSD
 #include <signal.h>
-#include <stddef.h>		/* For NULL.  */
+#define __need_NULL
+#include <stddef.h>
 #ifdef __UCLIBC_HAS_THREADS_NATIVE__
 #include <sysdep-cancel.h>
 #endif

+ 0 - 1
libc/signal/sigrelse.c

@@ -22,7 +22,6 @@
 #include <stddef.h>
 #include <signal.h>
 
-
 int sigrelse (int sig)
 {
   sigset_t set;

+ 1 - 2
libc/signal/sigset.c

@@ -20,8 +20,7 @@
 #define __need_NULL
 #include <stddef.h>
 #include <signal.h>
-#include <string.h>	/* For the real memset prototype.  */
-
+#include <string.h>
 
 /* Set the disposition for SIG.  */
 __sighandler_t sigset (int sig, __sighandler_t disp)

+ 0 - 1
libc/signal/sigsetmask.c

@@ -17,7 +17,6 @@
    02111-1307 USA.  */
 
 #define __UCLIBC_HIDE_DEPRECATED__
-#include <errno.h>
 #include <signal.h>
 
 #include "sigset-cvt-mask.h"

+ 0 - 33
libc/signal/sigsetops.h

@@ -1,33 +0,0 @@
-/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
-
-/* Definitions relevant to functions that operate on `sigset_t's.  */
-
-#include <errno.h>
-#include <signal.h>
-#include <string.h>
-
-#define	BITS		(_NSIG - 1)
-#define	ELT(signo)	(((signo) - 1) / BITS)
-#define	MASK(signo)	(1 << (((signo) - 1) % BITS))
-
-#undef	sigemptyset
-#undef	sigfillset
-#undef	sigaddset
-#undef	sigdelset
-#undef	sigismember

+ 5 - 3
libc/signal/sigwait.c

@@ -19,15 +19,15 @@
  * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  * 02111-1307 USA.  */
 
-#include <errno.h>
+#define __need_NULL
+#include <stddef.h>
 #include <signal.h>
-#include <string.h>
-#include <unistd.h>
 
 #ifdef __UCLIBC_HAS_THREADS_NATIVE__
 # include <sysdep-cancel.h>
 
 # ifdef __NR_rt_sigtimedwait
+#  include <string.h>
 
 /* Return any pending signal or wait for one for the given time.  */
 static int do_sigwait(const sigset_t *set, int *sig)
@@ -104,6 +104,8 @@ int sigwait (const sigset_t *set, int *sig)
 }
 
 # else /* __UCLIBC_HAS_REALTIME__ */
+# include <errno.h>
+# include <unistd.h>	/* smallint */
 /* variant without REALTIME extensions */
 
 static smallint was_sig; /* obviously not thread-safe */

+ 0 - 2
libc/signal/sysv_signal.c

@@ -18,8 +18,6 @@
 
 #include <errno.h>
 #include <signal.h>
-#include <string.h>	/* For the real memset prototype.  */
-
 
 /* Tolerate non-threads versions of Posix */
 #ifndef SA_ONESHOT