mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-07-27 12:37:35 +00:00
coverity: #1425748
Time of check time of use Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
parent
48cfd5db4f
commit
b29e05d629
@ -1581,13 +1581,13 @@ static int lxc_setup_devpts(struct lxc_conf *conf)
|
|||||||
DEBUG("Mount new devpts instance with options \"%s\"", devpts_mntopts);
|
DEBUG("Mount new devpts instance with options \"%s\"", devpts_mntopts);
|
||||||
|
|
||||||
/* Remove any pre-existing /dev/ptmx file. */
|
/* Remove any pre-existing /dev/ptmx file. */
|
||||||
ret = access("/dev/ptmx", F_OK);
|
ret = remove("/dev/ptmx");
|
||||||
if (!ret) {
|
if (ret < 0) {
|
||||||
ret = remove("/dev/ptmx");
|
if (errno != ENOENT) {
|
||||||
if (ret < 0) {
|
|
||||||
SYSERROR("Failed to remove existing \"/dev/ptmx\" file");
|
SYSERROR("Failed to remove existing \"/dev/ptmx\" file");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
DEBUG("Removed existing \"/dev/ptmx\" file");
|
DEBUG("Removed existing \"/dev/ptmx\" file");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user