From fd500d4396f910e4cf759e0fffa4daf4ed24745a Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Sat, 23 Aug 2014 02:14:36 -0700 Subject: porting: Provide setfattr/getfattr implementation - Use 'getfattr' properly avoid redundant options during xattr query - Untabify certain parts of tests (remove tabs) - Avoid backtick evaluation for certain values to make code more portable. - Use awk on FreeBSD/Darwin, since 'wc' implementation is broken and adds spurious spaces in its output. Change-Id: I7dcc0b70874e43b4cda8c306ed18a31b7a3f990a BUG: 1131713 Signed-off-by: Harshavardhana Reviewed-on: http://review.gluster.org/8520 Tested-by: Gluster Build System Reviewed-by: Emmanuel Dreyfus Tested-by: Emmanuel Dreyfus --- tests/fileio.rc | 56 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) (limited to 'tests/fileio.rc') diff --git a/tests/fileio.rc b/tests/fileio.rc index 58871b3b97a..ec0767832e8 100644 --- a/tests/fileio.rc +++ b/tests/fileio.rc @@ -2,53 +2,53 @@ function fd_available() { for i in {1..65536}; do - if [ ! -e /proc/$$/fd/$i ]; then - echo $i; - return 0; - fi - done + if [ ! -e /proc/$$/fd/$i ]; then + echo $i; + return 0; + fi + done - return 1; + return 1; } function fd_open() { - local fd=$1; - local mode=$2 - local path=$3; - - case $mode in - r) - eval "exec $fd<$path";; - w) - eval "exec $fd>$path";; - rw) - eval "exec $fd<>$path";; - *) - false;; - esac + local fd=$1; + local mode=$2 + local path=$3; + + case $mode in + r) + eval "exec $fd<$path";; + w) + eval "exec $fd>$path";; + rw) + eval "exec $fd<>$path";; + *) + false;; + esac } function fd_cat() { - local fd=$1; + local fd=$1; - eval "cat <&$fd"; + eval "cat <&$fd"; } function fd_write() { - local fd=$1; - shift; - local msg="$@"; + local fd=$1; + shift; + local msg="$@"; - eval "echo $@ >&$fd"; + eval "echo $@ >&$fd"; } function fd_close() { - local fd=$1; + local fd=$1; - eval "exec $fd>&-"; + eval "exec $fd>&-"; } -- cgit