mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-14 16:46:21 +00:00
lsm/apparmor: use cleanup macro
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
parent
0e8effda05
commit
a36e286bea
@ -611,8 +611,8 @@ out:
|
||||
|
||||
static bool file_is_yes(const char *path)
|
||||
{
|
||||
__do_close int fd = -EBADF;
|
||||
ssize_t rd;
|
||||
int fd;
|
||||
char buf[8]; /* we actually just expect "yes" or "no" */
|
||||
|
||||
fd = open(path, O_RDONLY | O_CLOEXEC);
|
||||
@ -620,7 +620,6 @@ static bool file_is_yes(const char *path)
|
||||
return false;
|
||||
|
||||
rd = lxc_read_nointr(fd, buf, sizeof(buf));
|
||||
close(fd);
|
||||
|
||||
return rd >= 4 && strnequal(buf, "yes\n", 4);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user