attach: use new mount api

parent 20d81c40
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include "macro.h" #include "macro.h"
#include "mainloop.h" #include "mainloop.h"
#include "memory_utils.h" #include "memory_utils.h"
#include "mount_utils.h"
#include "namespace.h" #include "namespace.h"
#include "process_utils.h" #include "process_utils.h"
#include "syscall_wrappers.h" #include "syscall_wrappers.h"
...@@ -202,7 +203,7 @@ int lxc_attach_remount_sys_proc(void) ...@@ -202,7 +203,7 @@ int lxc_attach_remount_sys_proc(void)
if (ret < 0) if (ret < 0)
return log_error_errno(-1, errno, "Failed to unmount /proc"); return log_error_errno(-1, errno, "Failed to unmount /proc");
ret = mount("none", "/proc", "proc", 0, NULL); ret = mount_filesystem("proc", "/proc", 0);
if (ret < 0) if (ret < 0)
return log_error_errno(-1, errno, "Failed to remount /proc"); return log_error_errno(-1, errno, "Failed to remount /proc");
...@@ -215,7 +216,7 @@ int lxc_attach_remount_sys_proc(void) ...@@ -215,7 +216,7 @@ int lxc_attach_remount_sys_proc(void)
return log_error_errno(-1, errno, "Failed to unmount /sys"); return log_error_errno(-1, errno, "Failed to unmount /sys");
/* Remount it. */ /* Remount it. */
if (ret == 0 && mount("none", "/sys", "sysfs", 0, NULL)) if (ret == 0 && mount_filesystem("sysfs", "/sys", 0))
return log_error_errno(-1, errno, "Failed to remount /sys"); return log_error_errno(-1, errno, "Failed to remount /sys");
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