]> granicus.if.org Git - strace/commitdiff
maint: fix ioctls_sym.sh premature termination
authorGleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
Wed, 28 Jun 2017 17:39:54 +0000 (20:39 +0300)
committerDmitry V. Levin <ldv@altlinux.org>
Thu, 29 Jun 2017 09:17:18 +0000 (09:17 +0000)
When the list of headers do not fit into the command line, xargs splits
it into several lists and then passes them to grep.  If no headers from
a list match the grep pattern, grep exits with a non-zero status that
causes xargs to exit with a non-zero status, too.

* maint/ioctls_sym.sh: Use "find -exec +" instead of xargs,
ignore its exit status.

maint/ioctls_sym.sh

index d9551b74152946ed3db6ffd7cfcbfaca5a6fd04d..1d50850796fdd1369d1bfee7ba9371c3d8d85a49 100755 (executable)
@@ -75,9 +75,10 @@ tmpdir="$(mktemp -dt "$me.XXXXXX")"
 # list interesting files in $inc_dir.
 cd "$inc_dir"
 inc_dir="$(pwd -P)"
-find . -type f -name '*.h' -print0 |
-       xargs -r0 grep -l "$r_value" -- > "$tmpdir"/headers1.list ||
-               exit 0
+find . -type f -name '*.h' -exec grep -l "$r_value" -- '{}' + \
+       > "$tmpdir"/headers1.list ||:
+[ -s "$tmpdir"/headers1.list ] || exit 0
+
 cd - > /dev/null
 sed 's|^\./\(uapi/\)\?||' < "$tmpdir"/headers1.list > "$tmpdir"/headers.list
 LC_COLLATE=C sort -u -o "$tmpdir"/headers.list "$tmpdir"/headers.list