2007-10-13 Marco Ciampa <ciampix@libero.it>
[midnight-commander.git] / vfs / tcputil.c
blob34c6263baa5604c4b0b562618feec97a0c67da35
1 /* Network utilities for the Midnight Commander Virtual File System.
3 Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2005, 2007
4 Free Software Foundation, Inc.
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public License
8 as published by the Free Software Foundation; either version 2 of
9 the License, or (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU Library General Public License for more details.
16 You should have received a copy of the GNU Library General Public
17 License along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
20 #include <config.h>
21 #include <stdlib.h>
22 #include <stdio.h>
23 #include <signal.h>
24 #include <sys/types.h>
26 #include "tcputil.h"
28 int got_sigpipe;
30 static void
31 sig_pipe (int unused)
33 (void) unused;
34 got_sigpipe = 1;
37 void
38 tcp_init (void)
40 struct sigaction sa;
42 got_sigpipe = 0;
43 sa.sa_handler = sig_pipe;
44 sa.sa_flags = 0;
45 sigemptyset (&sa.sa_mask);
46 sigaction (SIGPIPE, &sa, NULL);