diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2006-01-02 06:36:55 +0000 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2006-01-02 06:36:55 +0000 |
commit | 4aff81e69a0c3ce376e331a088f0839335f8400d (patch) | |
tree | 23a0df2e35f923a0b88c983f879c4e7a7880ee53 /src | |
parent | faac2ccac55f6dcfb268a94d5371f99e34d7f6fc (diff) | |
download | coreutils-4aff81e69a0c3ce376e331a088f0839335f8400d.tar.xz |
Include lchmod.h.
(re_protect, make_dir_parents_private): Use lchmod rather than chmod.
Diffstat (limited to 'src')
-rw-r--r-- | src/cp.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -1,5 +1,5 @@ /* cp.c -- file copying (main routines) - 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 @@ -30,6 +30,7 @@ #include "error.h" #include "dirname.h" #include "filenamecat.h" +#include "lchmod.h" #include "quote.h" #include "quotearg.h" #include "stat-time.h" @@ -335,7 +336,7 @@ re_protect (char const *const_dst_name, size_t src_offset, } else if (p->restore_mode) { - if (chmod (dst_name, p->mode)) + if (lchmod (dst_name, p->mode) != 0) { error (0, errno, _("failed to preserve permissions for %s"), quote (dst_name)); @@ -466,7 +467,7 @@ make_dir_parents_private (char const *const_dir, size_t src_offset, new->mode = stats.st_mode; new->restore_mode = true; - if (chmod (dir, stats.st_mode | S_IRWXU)) + if (lchmod (dir, stats.st_mode | S_IRWXU) != 0) { error (0, errno, _("setting permissions for %s"), quote (dir)); |