summaryrefslogtreecommitdiffstats
path: root/tests/fileio.rc
diff options
context:
space:
mode:
Diffstat (limited to 'tests/fileio.rc')
-rw-r--r--tests/fileio.rc56
1 files changed, 28 insertions, 28 deletions
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>&-";
}