public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers3@gmail.com>
To: fstests@vger.kernel.org
Cc: Eric Biggers <ebiggers@google.com>
Subject: [PATCH 1/2] common/config: make set_prog_path() accept one argument only
Date: Fri,  5 May 2017 17:19:32 -0700	[thread overview]
Message-ID: <20170506001933.49582-1-ebiggers3@gmail.com> (raw)

From: Eric Biggers <ebiggers@google.com>

All callers of set_prog_path() pass it only one argument, the program to
find on the $PATH.  Therefore, to simplify things remove the unused code
which allowed fallback paths to be specified in the remaining arguments.

Signed-off-by: Eric Biggers <ebiggers@google.com>
---
 common/config | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/common/config b/common/config
index 59041a39..b29c0eb0 100644
--- a/common/config
+++ b/common/config
@@ -93,7 +93,7 @@ export LOCAL_CONFIGURE_OPTIONS=${LOCAL_CONFIGURE_OPTIONS:=--enable-readline=yes}
 
 export RECREATE_TEST_DEV=false
 
-# $1 = prog to look for, $2* = default pathnames if not found in $PATH
+# $1 = prog to look for
 set_prog_path()
 {
     p=`which $1 2> /dev/null`
@@ -101,17 +101,6 @@ set_prog_path()
         echo $p
         return 0
     fi
-    p=$1
-
-    shift
-    for f; do
-        if [ -x $f ]; then
-            echo $f
-            return 0
-        fi
-    done
-
-    echo ""
     return 1
 }
 
-- 
2.13.0.rc1.294.g07d810a77f-goog


             reply	other threads:[~2017-05-06  0:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-06  0:19 Eric Biggers [this message]
2017-05-06  0:19 ` [PATCH 2/2] common/config: implement set_prog_path() using 'type -P' Eric Biggers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170506001933.49582-1-ebiggers3@gmail.com \
    --to=ebiggers3@gmail.com \
    --cc=ebiggers@google.com \
    --cc=fstests@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox