From c5475c04c00783d8b55ce5d5b4a3dc55eb16dac6 Mon Sep 17 00:00:00 2001
From: Jann Horn <jann@thejh.net>
Date: Sun, 19 May 2013 20:29:01 +0200
Subject: [PATCH] fix get_ioctl_names.sh

---
 get_ioctl_names.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/get_ioctl_names.sh b/get_ioctl_names.sh
index 7fe9fff..2b4c39a 100755
--- a/get_ioctl_names.sh
+++ b/get_ioctl_names.sh
@@ -27,7 +27,7 @@ if [ "$(echo "$symbol_file"|wc -l)" -gt 1 ]; then
   exit 1
 fi
 cd "$kernel_src"
-grep_res="$(grep -R -n "\(^\| \)$method_symbol *\($\|(\)" "$symbol_file")"
+grep_res="$(grep -R -n "^\(\|\S.* \)$method_symbol *\($\|(\)" "$symbol_file")"
 if [ -z "$grep_res" ]; then
   echo "error: can't find method in source"
   exit 1
@@ -35,6 +35,7 @@ fi
 echo "$grep_res"
 if [ "$(echo "$grep_res"|wc -l)" -gt 1 ]; then
   echo "error: too many results"
+  exit 1
 fi
 symbol_line="$(echo "$grep_res" | cut -d':' -f1)"
 echo "symbol is in $symbol_file, line $symbol_line"
-- 
2.20.1