* [LTP] [PATCH] lstat/lstat03.c: Fix broken file type check
@ 2014-06-05 6:33 Nicolas Joly
2014-06-05 9:54 ` chrubis
0 siblings, 1 reply; 2+ messages in thread
From: Nicolas Joly @ 2014-06-05 6:33 UTC (permalink / raw)
To: ltp-list
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)) ||
(stat_buf.st_size != strlen(TESTFILE))) {
tst_resm(TFAIL, "Functionality of lstat(2) on "
"'%s' Failed", SFILE);
--
1.9.0
------------------------------------------------------------------------------
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [LTP] [PATCH] lstat/lstat03.c: Fix broken file type check
2014-06-05 6:33 [LTP] [PATCH] lstat/lstat03.c: Fix broken file type check Nicolas Joly
@ 2014-06-05 9:54 ` chrubis
0 siblings, 0 replies; 2+ messages in thread
From: chrubis @ 2014-06-05 9:54 UTC (permalink / raw)
To: Nicolas Joly; +Cc: ltp-list
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-06-05 9:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-05 6:33 [LTP] [PATCH] lstat/lstat03.c: Fix broken file type check Nicolas Joly
2014-06-05 9:54 ` chrubis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox