coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

coreutils-8.20.patch002


From: Alexey Potehin
Subject: coreutils-8.20.patch002
Date: Sun, 10 Feb 2013 22:34:13 +0400

Hello people!

This is path for chmod speedup (chmod only if newmode != oldmode), in attach too:

--- a/src/chmod.c
+++ b/src/chmod.c
@@ -268,14 +268,23 @@ process_file (FTS *fts, FTSENT *ent)
.
       if (! S_ISLNK (old_mode))
         {
-          if (chmodat (fts->fts_cwd_fd, file, new_mode) == 0)
-            chmod_succeeded = true;
+          if ((old_mode & CHMOD_MODE_BITS) != (new_mode & CHMOD_MODE_BITS))
+            {
+              if (chmodat (fts->fts_cwd_fd, file, new_mode) == 0)
+                chmod_succeeded = true;
+              else
+                {
+                  if (! force_silent)
+                    {
+                      error (0, errno, _("changing permissions of %s"),
+                             quote (file_full_name));
+                    }
+                  ok = false;
+                }
+            }
           else
             {
-              if (! force_silent)
-                error (0, errno, _("changing permissions of %s"),
-                       quote (file_full_name));
-              ok = false;
+              chmod_succeeded = true; // skip set permissions
             }
         }
     }


Attachment: coreutils-8.20.patch002.tar.gz
Description: GNU Zip compressed data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]