tcputil.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /* Network utilities for the Midnight Commander Virtual File System.
  2. Copyright (C) 1995, 1996 Miguel de Icaza
  3. This program is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Library General Public License
  5. as published by the Free Software Foundation; either version 2 of
  6. the License, or (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU Library General Public License for more details.
  11. You should have received a copy of the GNU Library General Public
  12. License along with this program; if not, write to the Free Software
  13. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
  14. #include <config.h>
  15. #include <stdlib.h>
  16. #include <stdio.h>
  17. #include <signal.h>
  18. #include <sys/types.h>
  19. #include "tcputil.h"
  20. #include "utilvfs.h"
  21. int got_sigpipe;
  22. static void
  23. sig_pipe (int unused)
  24. {
  25. got_sigpipe = 1;
  26. }
  27. void
  28. tcp_init (void)
  29. {
  30. struct sigaction sa;
  31. got_sigpipe = 0;
  32. sa.sa_handler = sig_pipe;
  33. sa.sa_flags = 0;
  34. sigemptyset (&sa.sa_mask);
  35. sigaction (SIGPIPE, &sa, NULL);
  36. }