diff options
Diffstat (limited to 'utility.c')
-rw-r--r-- | utility.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -217,10 +217,12 @@ copyFile( const char *srcName, const char *destName, | |||
217 | if (setModes == TRUE) { | 217 | if (setModes == TRUE) { |
218 | //fprintf(stderr, "Setting permissions for %s\n", destName); | 218 | //fprintf(stderr, "Setting permissions for %s\n", destName); |
219 | chmod(destName, srcStatBuf.st_mode); | 219 | chmod(destName, srcStatBuf.st_mode); |
220 | if (followLinks == TRUE) | 220 | #if (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 1) |
221 | chown(destName, srcStatBuf.st_uid, srcStatBuf.st_gid); | 221 | if (followLinks == FALSE) |
222 | else | ||
223 | lchown(destName, srcStatBuf.st_uid, srcStatBuf.st_gid); | 222 | lchown(destName, srcStatBuf.st_uid, srcStatBuf.st_gid); |
223 | else | ||
224 | #endif | ||
225 | chown(destName, srcStatBuf.st_uid, srcStatBuf.st_gid); | ||
224 | 226 | ||
225 | times.actime = srcStatBuf.st_atime; | 227 | times.actime = srcStatBuf.st_atime; |
226 | times.modtime = srcStatBuf.st_mtime; | 228 | times.modtime = srcStatBuf.st_mtime; |