summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorKarel Zak2012-01-04 14:25:21 +0100
committerKarel Zak2012-01-04 14:25:21 +0100
commitd05a3e971366923d3d9ce65e1afb373188b06b10 (patch)
tree0d596b7e57ef36bfd38dcb6d2b993f862a20df6b /tools
parentcolumn: use xalloc libs (diff)
downloadkernel-qcow2-util-linux-d05a3e971366923d3d9ce65e1afb373188b06b10.tar.gz
kernel-qcow2-util-linux-d05a3e971366923d3d9ce65e1afb373188b06b10.tar.xz
kernel-qcow2-util-linux-d05a3e971366923d3d9ce65e1afb373188b06b10.zip
build-sys: add checkxalloc to toplevel Makefile
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/checkxalloc.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/checkxalloc.sh b/tools/checkxalloc.sh
index 89940fe23..578340e26 100755
--- a/tools/checkxalloc.sh
+++ b/tools/checkxalloc.sh
@@ -11,3 +11,13 @@ cd "$(git rev-parse --show-toplevel)" || {
git grep -zl '#include "xalloc.h"' |
xargs -0 grep -nwE '[^x](([cm]|re)alloc|strdup)\('
+
+result=$?
+
+if [ $result -eq 123 ]; then
+ exit 0 # not found
+elif [ $result -eq 0 ]; then
+ exit 1 # found
+fi
+
+exit $result