[CRIU] [PATCH 08/13] crtools: remove declaration of rt_sigset_t

Andrey Vagin avagin at openvz.org
Fri Mar 15 09:49:19 EDT 2013


Actually rt_sigset_t and k_rtsigset_t are the same

Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 arch/arm/include/asm/types.h | 17 ++++++-----------
 arch/x86/include/asm/types.h | 18 +++++++-----------
 cr-restore.c                 |  2 +-
 include/sigframe.h           |  4 ++--
 pie/parasite.c               |  2 +-
 pie/restorer.c               |  6 +++---
 6 files changed, 20 insertions(+), 29 deletions(-)

diff --git a/arch/arm/include/asm/types.h b/arch/arm/include/asm/types.h
index 069be66..715d1c8 100644
--- a/arch/arm/include/asm/types.h
+++ b/arch/arm/include/asm/types.h
@@ -77,23 +77,12 @@ typedef signed char		s8;
 #define _LINUX_CAPABILITY_U32S_3	2
 
 
-typedef struct {
-	unsigned long sig[2];
-} rt_sigset_t;
-
 typedef void rt_signalfn_t(int, siginfo_t *, void *);
 typedef rt_signalfn_t *rt_sighandler_t;
 
 typedef void rt_restorefn_t(void);
 typedef rt_restorefn_t *rt_sigrestore_t;
 
-typedef struct {
-	rt_sighandler_t	rt_sa_handler;
-	unsigned long	rt_sa_flags;
-	rt_sigrestore_t	rt_sa_restorer;
-	rt_sigset_t	rt_sa_mask;
-} rt_sigaction_t;
-
 #define _KNSIG		64
 #define _NSIG_BPW	32
 
@@ -110,6 +99,12 @@ static inline void ksigfillset(k_rtsigset_t *set)
 		set->sig[i] = (unsigned long)-1;
 }
 
+typedef struct {
+	rt_sighandler_t	rt_sa_handler;
+	unsigned long	rt_sa_flags;
+	rt_sigrestore_t	rt_sa_restorer;
+	k_rtsigset_t	rt_sa_mask;
+} rt_sigaction_t;
 
 /*
  * Copied from the Linux kernel header arch/arm/include/asm/ptrace.h
diff --git a/arch/x86/include/asm/types.h b/arch/x86/include/asm/types.h
index d33dfb5..79fd448 100644
--- a/arch/x86/include/asm/types.h
+++ b/arch/x86/include/asm/types.h
@@ -86,23 +86,12 @@ typedef signed char		s8;
 #define _LINUX_CAPABILITY_VERSION_3	0x20080522
 #define _LINUX_CAPABILITY_U32S_3	2
 
-typedef struct {
-	unsigned long sig[1];
-} rt_sigset_t;
-
 typedef void rt_signalfn_t(int, siginfo_t *, void *);
 typedef rt_signalfn_t *rt_sighandler_t;
 
 typedef void rt_restorefn_t(void);
 typedef rt_restorefn_t *rt_sigrestore_t;
 
-typedef struct {
-	rt_sighandler_t	rt_sa_handler;
-	unsigned long	rt_sa_flags;
-	rt_sigrestore_t	rt_sa_restorer;
-	rt_sigset_t	rt_sa_mask;
-} rt_sigaction_t;
-
 #define _KNSIG           64
 # define _NSIG_BPW      64
 
@@ -120,6 +109,13 @@ static inline void ksigfillset(k_rtsigset_t *set)
 }
 
 typedef struct {
+	rt_sighandler_t	rt_sa_handler;
+	unsigned long	rt_sa_flags;
+	rt_sigrestore_t	rt_sa_restorer;
+	k_rtsigset_t	rt_sa_mask;
+} rt_sigaction_t;
+
+typedef struct {
 	unsigned int	entry_number;
 	unsigned int	base_addr;
 	unsigned int	limit;
diff --git a/cr-restore.c b/cr-restore.c
index 9b2d52c..bdba840 100644
--- a/cr-restore.c
+++ b/cr-restore.c
@@ -560,7 +560,7 @@ static int prepare_sigactions(int pid)
 		 * A pure syscall is used, because glibc
 		 * sigaction overwrites se_restorer.
 		 */
-		ret = sys_sigaction(sig, &act, &oact, sizeof(rt_sigset_t));
+		ret = sys_sigaction(sig, &act, &oact, sizeof(k_rtsigset_t));
 		if (ret == -1) {
 			pr_err("%d: Can't restore sigaction: %m\n", pid);
 			goto err;
diff --git a/include/sigframe.h b/include/sigframe.h
index 19c8d6f..5714836 100644
--- a/include/sigframe.h
+++ b/include/sigframe.h
@@ -30,8 +30,8 @@ struct rt_ucontext {
 	struct rt_ucontext	*uc_link;
 	rt_stack_t		uc_stack;
 	struct rt_sigcontext	uc_mcontext;
-	rt_sigset_t		uc_sigmask;	/* mask last for extensibility */
-	int                     __unused[32 - (sizeof (rt_sigset_t) / sizeof (int))];
+	k_rtsigset_t		uc_sigmask;	/* mask last for extensibility */
+	int                     __unused[32 - (sizeof (k_rtsigset_t) / sizeof (int))];
 	unsigned long           uc_regspace[128] __attribute__((__aligned__(8)));
 };
 
diff --git a/pie/parasite.c b/pie/parasite.c
index ec35a16..bfda754 100644
--- a/pie/parasite.c
+++ b/pie/parasite.c
@@ -64,7 +64,7 @@ static int dump_sigact(struct parasite_dump_sa_args *da)
 		if (sig == SIGKILL || sig == SIGSTOP)
 			continue;
 
-		ret = sys_sigaction(sig, NULL, &da->sas[i], sizeof(rt_sigset_t));
+		ret = sys_sigaction(sig, NULL, &da->sas[i], sizeof(k_rtsigset_t));
 		if (ret < 0) {
 			pr_err("sys_sigaction failed\n");
 			break;
diff --git a/pie/restorer.c b/pie/restorer.c
index d88fc7b..3282060 100644
--- a/pie/restorer.c
+++ b/pie/restorer.c
@@ -433,9 +433,9 @@ long __export_restore_task(struct task_restore_core_args *args)
 	rt_sigaction_t act;
 
 	task_entries = args->task_entries;
-	sys_sigaction(SIGCHLD, NULL, &act, sizeof(rt_sigset_t));
+	sys_sigaction(SIGCHLD, NULL, &act, sizeof(k_rtsigset_t));
 	act.rt_sa_handler = sigchld_handler;
-	sys_sigaction(SIGCHLD, &act, NULL, sizeof(rt_sigset_t));
+	sys_sigaction(SIGCHLD, &act, NULL, sizeof(k_rtsigset_t));
 
 	log_set_fd(args->logfd);
 	log_set_loglevel(args->loglevel);
@@ -727,7 +727,7 @@ long __export_restore_task(struct task_restore_core_args *args)
 
 	restore_finish_stage(CR_STATE_RESTORE);
 
-	sys_sigaction(SIGCHLD, &args->sigchld_act, NULL, sizeof(rt_sigset_t));
+	sys_sigaction(SIGCHLD, &args->sigchld_act, NULL, sizeof(k_rtsigset_t));
 
 	ret = restore_signals(args->siginfo, args->siginfo_nr, 1);
 	if (ret)
-- 
1.7.11.7



More information about the CRIU mailing list