sighold.c 635 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*!
  2. \file lib/manage/sighold.c
  3. \brief Manage Library - Hold signals
  4. (C) 2001-2011 by the GRASS Development Team
  5. This program is free software under the GNU General Public License
  6. (>=v2). Read the file COPYING that comes with GRASS for details.
  7. \author Original author CERL
  8. */
  9. #include <signal.h>
  10. #include <grass/config.h>
  11. /*!
  12. \brief Hold signals
  13. \param hold
  14. \return 0
  15. */
  16. int M__hold_signals(int hold)
  17. {
  18. RETSIGTYPE (*sig)() = hold ? SIG_IGN : SIG_DFL;
  19. signal(SIGINT, sig);
  20. #ifndef __MINGW32__
  21. signal(SIGQUIT, sig);
  22. #endif
  23. #ifdef SIGTSTP
  24. signal(SIGTSTP, sig);
  25. #endif
  26. return 0;
  27. }