From: Todd Zullinger Date: Tue, 2 Apr 2013 15:16:25 +0000 (-0400) Subject: Direct output from fail() to stderr X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=529a4ee39442c3f254955e036b8e5172d15e7be1;p=virt-what.git Direct output from fail() to stderr This allows callers to more easily differentiate valid output from errors. A recent example is facter. When calling virt-what for its virtual fact, it gets 'virt-what: this script must be run as root' as the fact value when run as non-root: $ facter | grep ^virtual virtual => virt-what: this script must be run as root This is mildly related to RHBZ #719611¹. ¹ https://bugzilla.redhat.com/show_bug.cgi?id=719611 (cherry picked from commit 2f47e0615dab2bb16c2ad1e9f1273b3b709aea54) --- diff --git a/virt-what.in b/virt-what.in index 21488e7..297956d 100644 --- a/virt-what.in +++ b/virt-what.in @@ -34,7 +34,7 @@ skip_qemu_kvm=false VERSION="@VERSION@" function fail { - echo "virt-what: $1" + echo "virt-what: $1" >&2 exit 1 }