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)
if (ret < 0 || (size_t)ret >= sizeof(devpts_mntopts))
return -1;
/* Unmount old devpts instance. */
ret = access("/dev/pts/ptmx", F_OK);
if (!ret) {
ret = umount("/dev/pts");
if (ret < 0) {
SYSERROR("Failed to unmount old devpts instance");
return -1;
}
ret = umount2("/dev/pts", MNT_DETACH);
if (ret < 0)
WARN("%s - Failed to unmount old devpts instance", strerror(errno));
else
DEBUG("Unmounted old devpts instance");
}
/* Create mountpoint for devpts instance. */
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