You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
920 B

  1. From e7dac76ce61039fefa58985c955afccb60dabe87 Mon Sep 17 00:00:00 2001
  2. From: Rosen Penev <rosenp@gmail.com>
  3. Date: Wed, 29 Apr 2020 15:55:55 -0700
  4. Subject: [PATCH] libisns: remove sighold and sigrelse
  5. The man page says that these are deprecated. Use sugprocmask as a replacement.
  6. ---
  7. include/libisns/util.h | 16 ++++++++++++----
  8. 1 file changed, 12 insertions(+), 4 deletions(-)
  9. --- a/include/libisns/util.h
  10. +++ b/include/libisns/util.h
  11. @@ -41,14 +41,22 @@ char * print_size(unsigned long);
  12. */
  13. static inline void signals_hold(void)
  14. {
  15. - sighold(SIGTERM);
  16. - sighold(SIGINT);
  17. + sigset_t s;
  18. +
  19. + sigemptyset(&s);
  20. + sigaddset(&s, SIGTERM);
  21. + sigaddset(&s, SIGINT);
  22. + sigprocmask(SIG_BLOCK, &s, 0);
  23. }
  24. static inline void signals_release(void)
  25. {
  26. - sigrelse(SIGTERM);
  27. - sigrelse(SIGINT);
  28. + sigset_t s;
  29. +
  30. + sigemptyset(&s);
  31. + sigaddset(&s, SIGTERM);
  32. + sigaddset(&s, SIGINT);
  33. + sigprocmask(SIG_UNBLOCK, &s, 0);
  34. }
  35. /*