]> git.proxmox.com Git - pve-common.git/commitdiff
Tools: make unshare behave like other perl syscalls
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 30 Oct 2015 09:31:00 +0000 (10:31 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 30 Oct 2015 10:03:55 +0000 (11:03 +0100)
Most syscall wrappers in perl return 1 on success and our
current use of Tools::unshare isn't using the return value
(yet), so let's fix this while we can.

Also it seems to make sense to use prototyping on syscalls
to add some compile-time argument checking.

src/PVE/Tools.pm

index c52a3d0ced935cf1a9c36c059688dd83c70b09f6..b6849f2378f33267c2cd5326cee3ab1e75e37b4f 100644 (file)
@@ -1169,9 +1169,9 @@ sub parse_host_and_port {
     return; # nothing
 }
 
-sub unshare {
+sub unshare($) {
     my ($flags) = @_;
-    syscall 272, $flags;
+    return 0 == syscall(272, $flags);
 }
 
 1;