Skip to content

Commit

Permalink
Use uints for chown
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Nov 14, 2022
1 parent d2a07ba commit 3734913
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core.c/IO/Path.pm6
Expand Up @@ -494,12 +494,12 @@ my class IO::Path is Cool does IO {

my str $path = self.absolute;
$uid = $uid.defined
?? $uid.Int
?? $uid.UInt
!! nqp::stat($path,nqp::const::STAT_UID);
$uid.throw if nqp::istype($uid,Failure);

$gid = $gid.defined
?? $gid.Int
?? $gid.UInt
!! nqp::stat($path,nqp::const::STAT_GID);
$gid.throw if nqp::istype($gid,Failure);

Expand All @@ -508,7 +508,7 @@ my class IO::Path is Cool does IO {
fail X::IO::Chown.new(
:path($!os-path), :$uid, :$gid, :os-error(.Str) );
}}
nqp::chown($path, nqp::unbox_i($uid), nqp::unbox_i($gid))
nqp::chown($path, nqp::unbox_u($uid), nqp::unbox_u($gid))
}
}
method unlink(IO::Path:D: --> True) {
Expand Down

0 comments on commit 3734913

Please sign in to comment.