Integrate podlators-1.25
[p5sagit/p5-mst-13.2.git] / lib / File / Temp.pm
index 3248a96..00c0309 100644 (file)
@@ -70,7 +70,7 @@ POSIX functions:
   $fh = tmpfile();
 
   ($fh, $file) = tmpnam();
-  ($fh, $file) = tmpfile();
+  $fh = tmpfile();
 
 
 Compatibility functions:
@@ -452,10 +452,10 @@ sub _gettemp {
       local $^F = 2;
 
       # Store callers umask
-      my $umask = umask() unless ($^O eq 'MacOS');
+      my $umask = umask();
 
       # Set a known umask
-      umask(066) unless ($^O eq 'MacOS');
+      umask(066);
 
       # Attempt to open the file
       my $open_success = undef;
@@ -472,14 +472,14 @@ sub _gettemp {
       if ( $open_success ) {
 
        # Reset umask
-       umask($umask) unless ($^O eq 'MacOS');
+       umask($umask) if defined $umask;
 
        # Opened successfully - return file handle and name
        return ($fh, $path);
 
       } else {
        # Reset umask
-       umask($umask) unless ($^O eq 'MacOS');
+       umask($umask) if defined $umask;
 
        # Error opening file - abort with error
        # if the reason was anything but EEXIST
@@ -494,22 +494,22 @@ sub _gettemp {
     } elsif ($options{"mkdir"}) {
 
       # Store callers umask
-      my $umask = umask() unless ($^O eq 'MacOS');
+      my $umask = umask();
 
       # Set a known umask
-      umask(066) unless ($^O eq 'MacOS');
+      umask(066);
 
       # Open the temp directory
       if (mkdir( $path, 0700)) {
        # created okay
        # Reset umask
-       umask($umask) unless ($^O eq 'MacOS');
+       umask($umask) if defined $umask;
 
        return undef, $path;
       } else {
 
        # Reset umask
-       umask($umask) unless ($^O eq 'MacOS');
+       umask($umask) if defined $umask;
 
        # Abort with error if the reason for failure was anything
        # except EEXIST
@@ -736,7 +736,7 @@ sub _is_verysafe {
   # Split directory into components - assume no file
   my ($volume, $directories, undef) = File::Spec->splitpath( $path, 1);
 
-  # Slightly less efficient than having a a function in File::Spec
+  # Slightly less efficient than having a function in File::Spec
   # to chop off the end of a directory or even a function that
   # can handle ../ in a directory tree
   # Sometimes splitdir() returns a blank at the end
@@ -1471,7 +1471,7 @@ sub tmpnam {
 
 =item B<tmpfile>
 
-In scalar context, returns the filehandle of a temporary file.
+Returns the filehandle of a temporary file.
 
   $fh = tmpfile();