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.

41 lines
1011 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. diff --git a/include/libisns/util.h b/include/libisns/util.h
  10. index e5ed037..f1b97f0 100644
  11. --- a/include/libisns/util.h
  12. +++ b/include/libisns/util.h
  13. @@ -41,14 +41,22 @@ char * print_size(unsigned long);
  14. */
  15. static inline void signals_hold(void)
  16. {
  17. - sighold(SIGTERM);
  18. - sighold(SIGINT);
  19. + sigset_t s;
  20. +
  21. + sigemptyset(&s);
  22. + sigaddset(&s, SIGTERM);
  23. + sigaddset(&s, SIGINT);
  24. + sigprocmask(SIG_BLOCK, &s, 0);
  25. }
  26. static inline void signals_release(void)
  27. {
  28. - sigrelse(SIGTERM);
  29. - sigrelse(SIGINT);
  30. + sigset_t s;
  31. +
  32. + sigemptyset(&s);
  33. + sigaddset(&s, SIGTERM);
  34. + sigaddset(&s, SIGINT);
  35. + sigprocmask(SIG_UNBLOCK, &s, 0);
  36. }
  37. /*