]> granicus.if.org Git - php/commitdiff
better error hanlding
authorTomas V.V.Cox <cox@php.net>
Sun, 19 Aug 2001 12:37:51 +0000 (12:37 +0000)
committerTomas V.V.Cox <cox@php.net>
Sun, 19 Aug 2001 12:37:51 +0000 (12:37 +0000)
pear/PEAR/Packager.php

index 0df36e03e1392add0563832c02ba0b8623049567..d09406d74593f6d0fbaf6377533369d9accd1bb5 100644 (file)
@@ -155,13 +155,13 @@ class PEAR_Packager extends PEAR_Common
                 }
             }
             //Maintain original file perms
-            $orig_perms = fileperms($fname);
+            $orig_perms = @fileperms($fname);
             if (!@copy($fname, $file)) {
                 $this->log(0, "could not copy $fname to $file");
             } else {
                 $this->log(2, "+ copying from $fname to $file");
+                @chmod($file, $orig_perms);
             }
-            chmod($file, $orig_perms);
         }
         // XXX TODO: Rebuild the package file as the old method did?