attach: simplify significantly

parent a2f65700
...@@ -22,14 +22,15 @@ ...@@ -22,14 +22,15 @@
*/ */
#include "config.h" #include "config.h"
#include <errno.h>
#include <fcntl.h>
#include <stddef.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <stddef.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/syscall.h>
#include <sys/un.h> #include <sys/un.h>
#include "log.h" #include "log.h"
......
...@@ -25,9 +25,10 @@ ...@@ -25,9 +25,10 @@
#include <sys/types.h> #include <sys/types.h>
#include <string.h> #include <string.h>
#include <unistd.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/syscall.h>
#include <errno.h> #include <errno.h>
#include <unistd.h>
#define TSTNAME "lxc-attach-test" #define TSTNAME "lxc-attach-test"
#define TSTOUT(fmt, ...) do { \ #define TSTOUT(fmt, ...) do { \
...@@ -78,7 +79,7 @@ static void test_attach_lsm_set_config(struct lxc_container *ct) ...@@ -78,7 +79,7 @@ static void test_attach_lsm_set_config(struct lxc_container *ct)
static int test_attach_lsm_func_func(void* payload) static int test_attach_lsm_func_func(void* payload)
{ {
TSTOUT("%s", lsm_process_label_get(getpid())); TSTOUT("%s", lsm_process_label_get(syscall(SYS_getpid)));
return 0; return 0;
} }
...@@ -189,7 +190,7 @@ static int test_attach_lsm_cmd(struct lxc_container *ct) { return 0; } ...@@ -189,7 +190,7 @@ static int test_attach_lsm_cmd(struct lxc_container *ct) { return 0; }
static int test_attach_func_func(void* payload) static int test_attach_func_func(void* payload)
{ {
TSTOUT("%d", getpid()); TSTOUT("%d", (int)syscall(SYS_getpid));
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment