[1/2] seccomp: Use own seccomp_metadata_t type

Submitted by Cyrill Gorcunov on May 23, 2018, 4:09 p.m.

Details

Message ID 20180523160907.31856-3-gorcunov@gmail.com
State New
Headers show

Patch hide | download patch | download mbox

diff --git a/compel/include/uapi/ptrace.h b/compel/include/uapi/ptrace.h
index fcc2d62b08e4..3f8814e4afa6 100644
--- a/compel/include/uapi/ptrace.h
+++ b/compel/include/uapi/ptrace.h
@@ -52,13 +52,12 @@ 
 
 #ifndef PTRACE_SECCOMP_GET_METADATA
 # define PTRACE_SECCOMP_GET_METADATA	0x420d
+#endif /* PTRACE_SECCOMP_GET_METADATA */
 
-struct seccomp_metadata {
+typedef struct {
 	uint64_t	filter_off;	/* Input: which filter */
 	uint64_t	flags;		/* Output: filter's flags */
-};
-
-#endif /* PTRACE_SECCOMP_GET_METADATA */
+} seccomp_metadata_t;
 
 #ifdef PTRACE_EVENT_STOP
 # if PTRACE_EVENT_STOP == 7 /* Bad value from Linux 3.1-3.3, fixed in 3.4 */
diff --git a/criu/seccomp.c b/criu/seccomp.c
index d5da6475fcf8..78a87352d133 100644
--- a/criu/seccomp.c
+++ b/criu/seccomp.c
@@ -131,7 +131,7 @@  int seccomp_dump_thread(pid_t tid_real, ThreadCoreEntry *thread_core)
 
 static int collect_filter(struct seccomp_entry *entry)
 {
-	struct seccomp_metadata meta_buf, *meta = &meta_buf;
+	seccomp_metadata_t meta_buf, *meta = &meta_buf;
 	struct seccomp_filter_chain *chain, *prev;
 	struct sock_filter buf[BPF_MAXINSNS];
 	size_t i;