public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: chrubis@suse.cz
To: Nicolas Joly <njoly@pasteur.fr>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH] lstat/lstat03.c: Fix broken file type check
Date: Thu, 5 Jun 2014 11:54:14 +0200	[thread overview]
Message-ID: <20140605095413.GA12025@rei> (raw)
In-Reply-To: <1401950028-7214-1-git-send-email-njoly@pasteur.fr>

Hi!
> Signed-off-by: Nicolas Joly <njoly@pasteur.fr>
> ---
>  testcases/kernel/syscalls/lstat/lstat03.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/testcases/kernel/syscalls/lstat/lstat03.c b/testcases/kernel/syscalls/lstat/lstat03.c
> index d48d1ab..2d8716c 100644
> --- a/testcases/kernel/syscalls/lstat/lstat03.c
> +++ b/testcases/kernel/syscalls/lstat/lstat03.c
> @@ -131,7 +131,7 @@ int main(int ac, char **av)
>  		 */
>  		if ((stat_buf.st_uid != user_id) ||
>  		    (stat_buf.st_gid != group_id) ||
> -		    (!(stat_buf.st_mode && S_IFLNK)) ||
> +		    (!(stat_buf.st_mode & S_IFLNK)) ||

Good catch, although this is not yet correct. The file types are not
bitflags so the correct way here is:

	((stat_buf.st_mode & S_IFMT) != S_IFLNK)

I've corrected the patch and pushed, thanks.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their 
applications. Written by three acclaimed leaders in the field, 
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

      reply	other threads:[~2014-06-05  9:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-05  6:33 [LTP] [PATCH] lstat/lstat03.c: Fix broken file type check Nicolas Joly
2014-06-05  9:54 ` chrubis [this message]

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=20140605095413.GA12025@rei \
    --to=chrubis@suse.cz \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=njoly@pasteur.fr \
    /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