]> git.proxmox.com Git - pve-common.git/blobdiff - src/PVE/Tools.pm
fix CLONE constant declaration
[pve-common.git] / src / PVE / Tools.pm
index c52a3d0ced935cf1a9c36c059688dd83c70b09f6..125c3073f0a2b32fb1cfc2185cbd47e4285305f0 100644 (file)
@@ -67,12 +67,12 @@ our $IPV6RE = "(?:" .
 
 our $IPRE = "(?:$IPV4RE|$IPV6RE)";
 
-use constant (CLONE_NEWNS   => 0x00020000,
+use constant {CLONE_NEWNS   => 0x00020000,
               CLONE_NEWUTS  => 0x04000000,
               CLONE_NEWIPC  => 0x08000000,
               CLONE_NEWUSER => 0x10000000,
               CLONE_NEWPID  => 0x20000000,
-              CLONE_NEWNET  => 0x40000000);
+              CLONE_NEWNET  => 0x40000000};
 
 sub run_with_timeout {
     my ($timeout, $code, @param) = @_;
@@ -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;