summaryrefslogtreecommitdiff
path: root/utility.c
diff options
context:
space:
mode:
Diffstat (limited to 'utility.c')
-rw-r--r--utility.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/utility.c b/utility.c
index 74df632..e5c177a 100644
--- a/utility.c
+++ b/utility.c
@@ -217,10 +217,12 @@ copyFile( const char *srcName, const char *destName,
if (setModes == TRUE) {
//fprintf(stderr, "Setting permissions for %s\n", destName);
chmod(destName, srcStatBuf.st_mode);
- if (followLinks == TRUE)
- chown(destName, srcStatBuf.st_uid, srcStatBuf.st_gid);
- else
+#if (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 1)
+ if (followLinks == FALSE)
lchown(destName, srcStatBuf.st_uid, srcStatBuf.st_gid);
+ else
+#endif
+ chown(destName, srcStatBuf.st_uid, srcStatBuf.st_gid);
times.actime = srcStatBuf.st_atime;
times.modtime = srcStatBuf.st_mtime;