mirror of
git://github.com/lxc/lxc
synced 2025-08-31 14:09:56 +00:00
lsm/apparmor: use cleanup macro
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user