]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Include lchmod.h.
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 2 Jan 2006 06:36:10 +0000 (06:36 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 2 Jan 2006 06:36:10 +0000 (06:36 +0000)
(copy_internal): Use lchmod rather than chmod.

src/copy.c

index 1bfb4da6b52d7933bae9db6b856591a7ad83e934..ed57f44035afa90b7ad3ff166ccf536cfc412dc9 100644 (file)
@@ -1,5 +1,5 @@
 /* copy.c -- core functions for copying files and directories
-   Copyright (C) 89, 90, 91, 1995-2005 Free Software Foundation.
+   Copyright (C) 89, 90, 91, 1995-2006 Free Software Foundation.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -44,6 +44,7 @@
 #include "getpagesize.h"
 #include "hash.h"
 #include "hash-pjw.h"
+#include "lchmod.h"
 #include "quote.h"
 #include "same.h"
 #include "savedir.h"
@@ -1499,7 +1500,7 @@ copy_internal (char const *src_name, char const *dst_name,
              dst_mode = dst_sb.st_mode;
              restore_dst_mode = true;
 
-             if (chmod (dst_name, dst_mode | S_IRWXU))
+             if (lchmod (dst_name, dst_mode | S_IRWXU) != 0)
                {
                  error (0, errno, _("setting permissions for %s"),
                         quote (dst_name));
@@ -1740,7 +1741,7 @@ copy_internal (char const *src_name, char const *dst_name,
     }
   else if (restore_dst_mode)
     {
-      if (chmod (dst_name, dst_mode))
+      if (lchmod (dst_name, dst_mode) != 0)
        {
          error (0, errno, _("preserving permissions for %s"),
                 quote (dst_name));