CpuSet write_to_cgroup: catch errors from close()
authorDietmar Maurer <dietmar@proxmox.com>
Wed, 21 Dec 2016 07:56:06 +0000 (08:56 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 21 Dec 2016 07:56:06 +0000 (08:56 +0100)
src/PVE/CpuSet.pm

index 483405e..9f76f38 100644 (file)
@@ -82,7 +82,7 @@ sub write_to_cgroup {
 
     open(my $fh, '>', $filename) || die "failed to open '$filename' - $!\n";
     PVE::Tools::safe_print($filename, $fh, "$value\n");
-    close($fh);
+    close($fh) || die "failed to close '$filename' - $!\n";
 }
 
 sub insert {