Skip Menu |

This queue is for tickets about the Lchmod CPAN distribution.

Report information
The Basics
Id: 111208
Status: open
Priority: 0/
Queue: Lchmod

People
Owner: Nobody in particular
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.02
Fixed in: (no value)



Subject: Special case for linux?
It seems lchmod() exists in linux, but is only a non-functional stub. This leads to test errors on linux systems: http://matrix.cpantesters.org/?dist=Lchmod%200.02 I think this special case should be handled. I think there could be two solutions: * if $^O eq 'linux', then try harder to detect that linux really does not support lchmod(), e.g. like this: diff --git i/lib/Lchmod.pm w/lib/Lchmod.pm index d105a79..7c708c3 100644 --- i/lib/Lchmod.pm +++ w/lib/Lchmod.pm @@ -37,6 +37,12 @@ sub import { ); }; $LCHMOD_AVAILABLE = 1 if !$@; + if ($LCHMOD_AVAILABLE && $^O eq 'linux') { + # linux has usually only a non-functional stub implemented + if (_sys_lchmod('', 0) == -1 && $! == _get_errno_func_not_impl()) { + $LCHMOD_AVAILABLE = 0; + } + } } # ? needed ? * alternatively check in t/01.lchmod.t after the first call to lchmod() the errno value, and if it is ENOSYS, then skip the remaining test cases
nice thanks! On Fri Jan 15 01:49:01 2016, SREZIC wrote: Show quoted text
> It seems lchmod() exists in linux, but is only a non-functional stub. > This leads to test errors on linux systems: > http://matrix.cpantesters.org/?dist=Lchmod%200.02 > > I think this special case should be handled. I think there could be > two solutions: > > * if $^O eq 'linux', then try harder to detect that linux really does > not support lchmod(), e.g. like this: > > diff --git i/lib/Lchmod.pm w/lib/Lchmod.pm > index d105a79..7c708c3 100644 > --- i/lib/Lchmod.pm > +++ w/lib/Lchmod.pm > @@ -37,6 +37,12 @@ sub import { > ); > }; > $LCHMOD_AVAILABLE = 1 if !$@; > + if ($LCHMOD_AVAILABLE && $^O eq 'linux') { > + # linux has usually only a non-functional stub implemented > + if (_sys_lchmod('', 0) == -1 && $! == > _get_errno_func_not_impl()) { > + $LCHMOD_AVAILABLE = 0; > + } > + } > } > > # ? needed ? > > > * alternatively check in t/01.lchmod.t after the first call to > lchmod() the errno value, and if it is ENOSYS, then skip the remaining > test cases