From 4dd5f7507eb3009bf9aa85f3accf6ffb5fa42662 Mon Sep 17 00:00:00 2001 From: Emmanuel Dreyfus Date: Sat, 28 Dec 2013 08:31:23 +0100 Subject: Use linkat() instead of link() for portability sake This is a backport of Iccd27ac076b7a74e40dcbaa1c4762fd3ad59da5f POSIX does not says wether link(2) on symlink should link on symlink itself or on target. Linux use symlink, most other systems use target. Using linkat(2) allows the behavior to be specified, so that the behavior is portable. Also fix configure test for NetBSD linkat(2), which ceased to work. BUG: 764655 Change-Id: Ifcabda5e81b15cd80982bcfc05afda4c9e5370ef Signed-off-by: Emmanuel Dreyfus Reviewed-on: http://review.gluster.org/6612 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/features/index/src/index.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'xlators/features/index/src/index.c') diff --git a/xlators/features/index/src/index.c b/xlators/features/index/src/index.c index 295f6819830..9fa32129eb5 100644 --- a/xlators/features/index/src/index.c +++ b/xlators/features/index/src/index.c @@ -409,7 +409,8 @@ sync_base_indices (void *index_priv) #ifdef HAVE_LINKAT /* see HAVE_LINKAT in xlators/storage/posix/src/posix.c */ - ret = linkat (AT_FDCWD, xattrop_index_path, AT_FDCWD, base_index_path, 0); + ret = linkat (AT_FDCWD, xattrop_index_path, + AT_FDCWD, base_index_path, 0); #else ret = link (xattrop_index_path, base_index_path); #endif -- cgit