From: Peng Haitao <penght@cn.fujitsu.com>
To: yanegomi@gmail.com
Cc: ltp-list@lists.sourceforge.net
Subject: [LTP] [PATCH] dup203: fix error of not using O_ACCMODE
Date: Wed, 19 Jan 2011 14:53:27 +0800 [thread overview]
Message-ID: <4D368A67.8000105@cn.fujitsu.com> (raw)
Hi Garrett,
The file access mode is extracted from the return value of function fcntl() using the mask O_ACCMODE.
Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
---
testcases/kernel/syscalls/dup2/dup203.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/testcases/kernel/syscalls/dup2/dup203.c b/testcases/kernel/syscalls/dup2/dup203.c
index 51a3579..0df92b4 100644
--- a/testcases/kernel/syscalls/dup2/dup203.c
+++ b/testcases/kernel/syscalls/dup2/dup203.c
@@ -170,7 +170,7 @@ int main(int ac, char **av)
"return value of 0x0, got %#x", rval);
break;
}
- if (((rval = fcntl(fd0, F_GETFL, 0)) != O_WRONLY)) {
+ if ((rval = (fcntl(fd0, F_GETFL, 0) & O_ACCMODE)) != O_WRONLY) {
tst_resm(TFAIL, "fctnl F_GETFL bad rval on fd0 "
"Expected %#x got %#x", O_WRONLY, rval);
}
@@ -212,4 +212,4 @@ void cleanup()
TEST_CLEANUP;
tst_rmdir();
-}
\ No newline at end of file
+}
--
1.7.3.1
--
Best Regards,
Peng Haitao
------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next reply other threads:[~2011-01-19 6:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-19 6:53 Peng Haitao [this message]
2011-01-19 7:46 ` [LTP] [PATCH] dup203: fix error of not using O_ACCMODE Garrett Cooper
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=4D368A67.8000105@cn.fujitsu.com \
--to=penght@cn.fujitsu.com \
--cc=ltp-list@lists.sourceforge.net \
--cc=yanegomi@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.