[libvirt] [PATCH] freebsd: Avoid /bin/true in commandtest

Rely on PATH and use just true, because on FreeBSD it's /usr/bin/true. --- tests/commanddata/test16.log | 2 +- tests/commandtest.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/commanddata/test16.log b/tests/commanddata/test16.log index 2433a4d..7088165 100644 --- a/tests/commanddata/test16.log +++ b/tests/commanddata/test16.log @@ -1 +1 @@ -A=B /bin/true C +A=B true C diff --git a/tests/commandtest.c b/tests/commandtest.c index 2e800ae..9ba53b8 100644 --- a/tests/commandtest.c +++ b/tests/commandtest.c @@ -566,9 +566,9 @@ cleanup: */ static int test16(const void *unused ATTRIBUTE_UNUSED) { - virCommandPtr cmd = virCommandNew("/bin/true"); + virCommandPtr cmd = virCommandNew("true"); char *outactual = NULL; - const char *outexpect = "A=B /bin/true C"; + const char *outexpect = "A=B true C"; int ret = -1; int fd = -1; @@ -610,7 +610,7 @@ cleanup: */ static int test17(const void *unused ATTRIBUTE_UNUSED) { - virCommandPtr cmd = virCommandNew("/bin/true"); + virCommandPtr cmd = virCommandNew("true"); int ret = -1; char *outbuf; char *errbuf; -- 1.7.4.1

On 07/28/2011 09:52 AM, Matthias Bolte wrote:
Rely on PATH and use just true, because on FreeBSD it's /usr/bin/true.
What fun. The autoconf manual has this gem under true, apropos to the current patch: | when asked whether false is more portable than true Alexandre Oliva answered: | | In a sense, yes, because if it doesn't exist, the shell will produce an exit status of failure, which is correct for false, but not for true. http://www.gnu.org/software/autoconf/manual/autoconf.html#Limitations-of-Bui...
--- tests/commanddata/test16.log | 2 +- tests/commandtest.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-)
ACK. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

2011/7/28 Eric Blake <eblake@redhat.com>:
On 07/28/2011 09:52 AM, Matthias Bolte wrote:
Rely on PATH and use just true, because on FreeBSD it's /usr/bin/true.
What fun. The autoconf manual has this gem under true, apropos to the current patch:
| when asked whether false is more portable than true Alexandre Oliva answered: | | In a sense, yes, because if it doesn't exist, the shell will produce an exit status of failure, which is correct for false, but not for true.
http://www.gnu.org/software/autoconf/manual/autoconf.html#Limitations-of-Bui...
--- tests/commanddata/test16.log | 2 +- tests/commandtest.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-)
ACK.
Thanks, pushed. -- Matthias Bolte http://photron.blogspot.com
participants (2)
-
Eric Blake
-
Matthias Bolte