]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
whoops. unbreak stat'ing of executables in path
authorDirk Mueller <daywalker@users.sourceforge.net>
Fri, 17 Oct 2003 00:25:07 +0000 (00:25 +0000)
committerDirk Mueller <daywalker@users.sourceforge.net>
Fri, 17 Oct 2003 00:25:07 +0000 (00:25 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1943

coregrind/valgrind.in

index 3325f096bcb4e81f66fdaf7d5112ea7779b8976c..a2fcd58935938d93e431b1441d693d6808a24a6c 100755 (executable)
@@ -110,9 +110,10 @@ if [ z"$nptl_threading" = zyes ]; then
    export LD_ASSUME_KERNEL 
 fi
 
+which_prog="`which $1`"
+
 # Ensure the program isn't statically linked.
 if [ $# != 0 ] ; then
-   which_prog="`which $1`"
    case `file "$which_prog"` in
    *"statically linked"*)
      echo "\`$which_prog' is statically linked"
@@ -124,8 +125,8 @@ if [ $# != 0 ] ; then
 fi
 
 # Ensure that there is no suid or sgid flag
-if [ `stat -c %a "$1"` -gt 2000 ] ; then
-  echo "\`$1' is suid/sgid."
+if [ `stat -c %a "$which_prog"` -gt 2000 ] ; then
+  echo "\`$which_prog' is suid/sgid."
   echo "Valgrind can't handle these executables, as it"
   echo "requires the LD_PRELOAD feature in order to work."
   echo ""