coverity: #1425748

Time of check time of use Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent be20cadb
...@@ -1541,16 +1541,11 @@ static int lxc_setup_devpts(struct lxc_conf *conf) ...@@ -1541,16 +1541,11 @@ static int lxc_setup_devpts(struct lxc_conf *conf)
if (ret < 0 || (size_t)ret >= sizeof(devpts_mntopts)) if (ret < 0 || (size_t)ret >= sizeof(devpts_mntopts))
return -1; return -1;
/* Unmount old devpts instance. */ ret = umount2("/dev/pts", MNT_DETACH);
ret = access("/dev/pts/ptmx", F_OK); if (ret < 0)
if (!ret) { WARN("%s - Failed to unmount old devpts instance", strerror(errno));
ret = umount("/dev/pts"); else
if (ret < 0) {
SYSERROR("Failed to unmount old devpts instance");
return -1;
}
DEBUG("Unmounted old devpts instance"); DEBUG("Unmounted old devpts instance");
}
/* Create mountpoint for devpts instance. */ /* Create mountpoint for devpts instance. */
ret = mkdir("/dev/pts", 0755); ret = mkdir("/dev/pts", 0755);
......
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