summaryrefslogtreecommitdiff
path: root/networking/udhcp/signalpipe.c
diff options
context:
space:
mode:
Diffstat (limited to 'networking/udhcp/signalpipe.c')
-rw-r--r--networking/udhcp/signalpipe.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/networking/udhcp/signalpipe.c b/networking/udhcp/signalpipe.c
index c181e0e06..6355c5e90 100644
--- a/networking/udhcp/signalpipe.c
+++ b/networking/udhcp/signalpipe.c
@@ -1,6 +1,5 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* signalpipe.c 2/*
3 *
4 * Signal pipe infrastructure. A reliable way of delivering signals. 3 * Signal pipe infrastructure. A reliable way of delivering signals.
5 * 4 *
6 * Russ Dill <Russ.Dill@asu.edu> December 2003 5 * Russ Dill <Russ.Dill@asu.edu> December 2003
@@ -19,10 +18,9 @@
19 * along with this program; if not, write to the Free Software 18 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 */ 20 */
22
23#include "common.h" 21#include "common.h"
24 22
25 23/* Global variable: we access it from signal handler */
26static struct fd_pair signal_pipe; 24static struct fd_pair signal_pipe;
27 25
28static void signal_handler(int sig) 26static void signal_handler(int sig)
@@ -32,7 +30,6 @@ static void signal_handler(int sig)
32 bb_perror_msg("can't send signal"); 30 bb_perror_msg("can't send signal");
33} 31}
34 32
35
36/* Call this before doing anything else. Sets up the socket pair 33/* Call this before doing anything else. Sets up the socket pair
37 * and installs the signal handler */ 34 * and installs the signal handler */
38void FAST_FUNC udhcp_sp_setup(void) 35void FAST_FUNC udhcp_sp_setup(void)
@@ -49,7 +46,6 @@ void FAST_FUNC udhcp_sp_setup(void)
49 , signal_handler); 46 , signal_handler);
50} 47}
51 48
52
53/* Quick little function to setup the rfds. Will return the 49/* Quick little function to setup the rfds. Will return the
54 * max_fd for use with select. Limited in that you can only pass 50 * max_fd for use with select. Limited in that you can only pass
55 * one extra fd */ 51 * one extra fd */
@@ -64,7 +60,6 @@ int FAST_FUNC udhcp_sp_fd_set(fd_set *rfds, int extra_fd)
64 return signal_pipe.rd > extra_fd ? signal_pipe.rd : extra_fd; 60 return signal_pipe.rd > extra_fd ? signal_pipe.rd : extra_fd;
65} 61}
66 62
67
68/* Read a signal from the signal pipe. Returns 0 if there is 63/* Read a signal from the signal pipe. Returns 0 if there is
69 * no signal, -1 on error (and sets errno appropriately), and 64 * no signal, -1 on error (and sets errno appropriately), and
70 * your signal on success */ 65 * your signal on success */