Fix -d option processing
When converting the path specified for -d to absolute path, an extra '/'
is added, e.g. if '/mypath' is specified, TMPBASE will be '//mypath'.
Some testcases fail because of this, e.g. chdir01A fails with:
chdir01 1 TFAIL : symlink(object, symbolic) was succesful.
mkdir(object, 0700) was successful
chdir(2) returned successfully, but getcwd(3) indicated new current
working directory location /ext4/ltp-2nHcAjcGKr/chd2Y4XkO/object not
equal to expected //ext4/ltp-2nHcAjcGKr/chd2Y4XkO/object
Signed-off-by: Simon Xu <xu.simon@oracle.com>
Reviewed-by: Garrett Cooper <yanegomi@gmail.com>
diff --git a/runltp b/runltp
index 0d77a6e..a515a18 100755
--- a/runltp
+++ b/runltp
@@ -235,7 +235,7 @@
esac ;;
d) # convert the user path to absolute path.
- export TMPBASE=`cd \`dirname ${OPTARG}\`; pwd`/`basename ${OPTARG}` ;;
+ export TMPBASE=$(readlink -f ${OPTARG}) ;;
D) NUM_PROCS=1; NUM_FILES=1; NUM_BYTES=$((1024 * 1024 * 1024)); CLEAN_FLAG=0
ARGUMENT_LIST=$OPTARG