diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2006-01-02 06:36:10 +0000 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2006-01-02 06:36:10 +0000 |
commit | faac2ccac55f6dcfb268a94d5371f99e34d7f6fc (patch) | |
tree | 87e82b7ac93a58137c1261941b134b126be3b187 /src | |
parent | e59703a1d682e2fee177637c8abe68caab66cea2 (diff) | |
download | coreutils-faac2ccac55f6dcfb268a94d5371f99e34d7f6fc.tar.xz |
Include lchmod.h.
(copy_internal): Use lchmod rather than chmod.
Diffstat (limited to 'src')
-rw-r--r-- | src/copy.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/copy.c b/src/copy.c index 1bfb4da6b..ed57f4403 100644 --- a/src/copy.c +++ b/src/copy.c @@ -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)); |