Fix a "Use of uninitialized value in numeric ne (!=)" warning when
syswrite returns undef when trying to change the apparmor profile.
Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
# Now switch our apparmor profile before mounting:
my $data = 'changeprofile pve-container-mounthotplug';
- if (syswrite($aa_fd, $data, length($data)) != length($data)) {
+ my $data_written = syswrite($aa_fd, $data, length($data));
+ if (!defined($data_written) || $data_written != length($data)) {
die "failed to change apparmor profile: $!\n";
}
# Check errors on close as well: