Re: [PATCH 3/3] tools/checkxalloc.sh: add new code checking script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Dec 20, 2011 at 08:36:04AM -0500, Dave Reisner wrote:
> Ask and you shall receive ;)

 Thanks :-)

>  tools/checkxalloc.sh |   14 ++++++++++++++
>  1 files changed, 14 insertions(+), 0 deletions(-)
>  create mode 100755 tools/checkxalloc.sh
> 
> diff --git a/tools/checkxalloc.sh b/tools/checkxalloc.sh
> new file mode 100755
> index 0000000..f8f8c8c
> --- /dev/null
> +++ b/tools/checkxalloc.sh
> @@ -0,0 +1,14 @@
> +#!/bin/sh
> +#
> +# Find files which include the xalloc.h header, but which still call
> +# the unwrapped calloc and malloc.
> +#
> +
> +cd "$(git rev-parse --show-toplevel)" || {
> +  echo "error: failed to chdir to git root"
> +  exit 1
> +}
> +
> +git grep -zl '#include "xalloc.h"' |
> +  xargs -0 grep -nwE '[^x](([cm]|re)alloc|strdup)\('

 Applied, with small improvement -- we need a proper return value
 (xargs returns too funny numbers) to make it usable from top-level
 Makefile.

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux