From 0fd19aa1c8a2bf543099d6b1077ff19078f9074e Mon Sep 17 00:00:00 2001
From: wangzhengquan <wangzhengquan85@126.com>
Date: 星期四, 24 十二月 2020 11:35:12 +0800
Subject: [PATCH] Merge branch 'dev'
---
test/test.c | 35 +++--------------------------------
1 files changed, 3 insertions(+), 32 deletions(-)
diff --git a/test/test.c b/test/test.c
index ab21287..40f5af7 100644
--- a/test/test.c
+++ b/test/test.c
@@ -1,39 +1,10 @@
#include "usg_common.h"
static void sig_quit(int);
+#define SIGCLOSE1 (SIGRTMIN +1)
int
main(void)
{
- sigset_t
- newmask, oldmask, pendmask;
- if (signal(SIGQUIT, sig_quit) == SIG_ERR)
- err_exit(errno, "can鈥檛 catch SIGQUIT");
- /*
- * Block SIGQUIT and save current signal mask.
- */
- sigemptyset(&newmask);
- sigaddset(&newmask, SIGQUIT);
- if (sigprocmask(SIG_BLOCK, &newmask, &oldmask) < 0)
- err_exit(errno, "SIG_BLOCK error");
- sleep(5);
- /* SIGQUIT here will remain pending */
- if (sigpending(&pendmask) < 0)
- err_exit(errno, "sigpending error");
- if (sigismember(&pendmask, SIGQUIT))
- printf("\nSIGQUIT pending\n");
- /*
- * Restore signal mask which unblocks SIGQUIT.
- */
- if (sigprocmask(SIG_SETMASK, &oldmask, NULL) < 0)
- err_exit(errno, "SIG_SETMASK error");
- printf("SIGQUIT unblocked\n");
- sleep(5);
- exit(0);
+ printf("%d, %d , %d\n", SIGRTMIN, SIGRTMAX, SIGCLOSE1);
/* SIGQUIT here will terminate with core file */
}
-
-static void sig_quit(int signo)
-{
- printf("caught SIGQUIT\n");
- if (signal(SIGQUIT, SIG_DFL) == SIG_ERR)
- err_exit(errno, "can鈥檛 reset SIGQUIT");
-}
+
\ No newline at end of file
--
Gitblit v1.8.0