coverity: #1425748

Time of check time of use Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent 48cfd5db
......@@ -1581,13 +1581,13 @@ static int lxc_setup_devpts(struct lxc_conf *conf)
DEBUG("Mount new devpts instance with options \"%s\"", devpts_mntopts);
/* Remove any pre-existing /dev/ptmx file. */
ret = access("/dev/ptmx", F_OK);
if (!ret) {
ret = remove("/dev/ptmx");
if (ret < 0) {
ret = remove("/dev/ptmx");
if (ret < 0) {
if (errno != ENOENT) {
SYSERROR("Failed to remove existing \"/dev/ptmx\" file");
return -1;
}
} else {
DEBUG("Removed existing \"/dev/ptmx\" file");
}
......
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