Skip Menu |

This queue is for tickets about the Proc-PID-File CPAN distribution.

Report information
The Basics
Id: 62380
Status: resolved
Priority: 0/
Queue: Proc-PID-File

People
Owner: Nobody in particular
Requestors: dpark [...] gelaed.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.27
Fixed in: 1.28



Subject: sysopen failure doesn't die as expected
The 'sysopen' calls in the 'read' and 'write' functions do not cause 'die' to be invoked as the code seems to indicate. For example, lines 282 and 283 from 'read': sysopen $fh, $self->{path}, O_RDWR|O_CREAT || die qq/Cannot open pid file "$self->{path}": $!\n/; In the event that the path cannot be opened, this will not die, but will instead fail silently. This in turn will cause the flock call to fail complaining about the invalid file descriptor. The problem is that '||' has higher precedence than ',', so O_RDWR|O_CREAT || die qq/Cannot open pid file "$self->{path}": $!\n/ is the third argument to sysopen. O_RDWR|O_CREAT evaluates to true, so the 'die' statement is never evaluated. The fix is to add parens around the sysopen arguments or to use 'or' instead of '||' (or both). Thanks, Derek
Fixed in 1.28. Thank you for your report.