util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Karel Zak <kzak@redhat.com>
To: Dave Reisner <d@falconindy.com>
Cc: util-linux@vger.kernel.org, Dave Reisner <dreisner@archlinux.org>
Subject: Re: [PATCH 3/3] tools/checkxalloc.sh: add new code checking script
Date: Wed, 4 Jan 2012 14:39:53 +0100	[thread overview]
Message-ID: <20120104133953.GE24350@x2.net.home> (raw)
In-Reply-To: <1324388164-2112-3-git-send-email-dreisner@archlinux.org>

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@redhat.com>
 http://karelzak.blogspot.com

  reply	other threads:[~2012-01-04 13:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-20 13:36 [PATCH 1/3] column: use xalloc libs Dave Reisner
2011-12-20 13:36 ` [PATCH 2/3] lscpu: " Dave Reisner
2012-01-04 13:37   ` Karel Zak
2011-12-20 13:36 ` [PATCH 3/3] tools/checkxalloc.sh: add new code checking script Dave Reisner
2012-01-04 13:39   ` Karel Zak [this message]
2011-12-20 14:13 ` [PATCH 1/3] column: use xalloc libs Davidlohr Bueso
2012-01-04 13:37   ` Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120104133953.GE24350@x2.net.home \
    --to=kzak@redhat.com \
    --cc=d@falconindy.com \
    --cc=dreisner@archlinux.org \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).