]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
attach: use new mount api
authorChristian Brauner <christian.brauner@ubuntu.com>
Wed, 22 Jul 2020 09:47:21 +0000 (11:47 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Thu, 23 Jul 2020 08:20:50 +0000 (10:20 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/attach.c

index 5443fee5f754735d0c195f8a7b89e85d67e9e77c..ad25aada9e3308df26fd882c42416bf851f0ed08 100644 (file)
@@ -39,6 +39,7 @@
 #include "macro.h"
 #include "mainloop.h"
 #include "memory_utils.h"
+#include "mount_utils.h"
 #include "namespace.h"
 #include "process_utils.h"
 #include "syscall_wrappers.h"
@@ -202,7 +203,7 @@ int lxc_attach_remount_sys_proc(void)
        if (ret < 0)
                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)
                return log_error_errno(-1, errno, "Failed to remount /proc");
 
@@ -215,7 +216,7 @@ int lxc_attach_remount_sys_proc(void)
                return log_error_errno(-1, errno, "Failed to unmount /sys");
 
        /* 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 0;