I've just found a bug in my module. The bug results in an
inappropriate infinite loop.
Before I fix the bug, I want to write up a test case.
I can reproduce the bug OK, but if I put that code into the module
tests, and the bug isn't fixed, or comes back for some reason, then
the test program w
Michael The Schwern <[EMAIL PROTECTED]> says:
> Use alarm and skip the test if $Config{d_alarm} is false (see
> t/op/alarm.t for an example). If you think the infinite loop is due
> to a programming glitch, as opposed to a cross-platform issue, this
> will be enough.
Thanks very much!
> The on
> I just thought of a clever way to do it without alarm!
So clever, it doesn't work!
> lock_file($foo);
> open(FH, $foo);
> ok( !flock(FH, LOCK_NB | LOCK_EX) );
Seriously, on most unix systems, the following:
flock(FH, LOCK_EX);
flock(FH, LOCK_EX|LOCK_NB) or die;
Supposing that Fcntl and O_RDONLY are known to be available, how
likely is it that O_ACCMODE will also be available? Are there any
platforms that have O_RDONLY but not O_ACCMODE?
> You probably already found out, but
>
> HP-UX 10.20 Has it defined as 003
> HP-UX 11.00 Has it defined as 003
> AIX 4.3.3.0 Has it defined as 3
> AIX 4.2.1.0 Has it defined as 3
Thanks for the information. It turns out some Win32 systems don't
have it at all, so I have to avo