X-Git-Url: http://git.thejh.net/?p=moctel.git;a=blobdiff_plain;f=get_ioctl_names.sh;h=2b4c39a58761a139c8b4877679b46bca22d2b497;hp=7fe9fffa4d7cc1c99d524f6cc77e63050fb5729a;hb=refs%2Fheads%2Fmaster;hpb=73d712f1a25728984f7f9b81d7c3d02694648b4f 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"