Skip to content

Commit

Permalink
Clear O_RDWR bit
Browse files Browse the repository at this point in the history
  • Loading branch information
timgimyee committed Oct 24, 2018
1 parent 4bb6eb6 commit 9121e34
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/File/Temp.pm
Original file line number Diff line number Diff line change
Expand Up @@ -503,15 +503,15 @@ sub _gettemp {
my $open_success = undef;
if ( $^O eq 'VMS' and $options{"unlink_on_close"} && !$KEEP_ALL) {
my $flags = $OPENFLAGS;
$flags = ($flags ^ O_RDWR) | O_WRONLY if $options{write_only};
$flags = ($flags & ~O_RDWR) | O_WRONLY if $options{write_only};
# make it auto delete on close by setting FAB$V_DLT bit
$fh = VMS::Stdio::vmssysopen($path, $flags, 0600, 'fop=dlt');
$open_success = $fh;
} else {
my $flags = ( ($options{"unlink_on_close"} && !$KEEP_ALL) ?
$OPENTEMPFLAGS :
$OPENFLAGS );
$flags = ($flags ^ O_RDWR) | O_WRONLY if $options{write_only};
$flags = ($flags & ~O_RDWR) | O_WRONLY if $options{write_only};
$flags |= $LOCKFLAG if (defined $LOCKFLAG && $options{use_exlock});
$open_success = sysopen($fh, $path, $flags, 0600);
}
Expand Down

0 comments on commit 9121e34

Please sign in to comment.