Skip to content

Commit 9121e34

Browse files
committed
Clear O_RDWR bit
1 parent 4bb6eb6 commit 9121e34

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/File/Temp.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,15 +503,15 @@ sub _gettemp {
503503
my $open_success = undef;
504504
if ( $^O eq 'VMS' and $options{"unlink_on_close"} && !$KEEP_ALL) {
505505
my $flags = $OPENFLAGS;
506-
$flags = ($flags ^ O_RDWR) | O_WRONLY if $options{write_only};
506+
$flags = ($flags & ~O_RDWR) | O_WRONLY if $options{write_only};
507507
# make it auto delete on close by setting FAB$V_DLT bit
508508
$fh = VMS::Stdio::vmssysopen($path, $flags, 0600, 'fop=dlt');
509509
$open_success = $fh;
510510
} else {
511511
my $flags = ( ($options{"unlink_on_close"} && !$KEEP_ALL) ?
512512
$OPENTEMPFLAGS :
513513
$OPENFLAGS );
514-
$flags = ($flags ^ O_RDWR) | O_WRONLY if $options{write_only};
514+
$flags = ($flags & ~O_RDWR) | O_WRONLY if $options{write_only};
515515
$flags |= $LOCKFLAG if (defined $LOCKFLAG && $options{use_exlock});
516516
$open_success = sysopen($fh, $path, $flags, 0600);
517517
}

0 commit comments

Comments
 (0)