On Wed, Mar 09, 2011 at 03:02:43PM +0100, Cyril Hrubis wrote:
> Hi!
> > +static void setup(void)
> > +{
> > + tst_tmpdir();
> > +
> > + fd = open(testfile, O_CREAT | O_RDWR);
>
> Sorry for not exposing this earlier. But you should specify mode for
> open with O_CREAT. That's part of the open() inteface that is kind of
> badly engineered...
Thanks. I have a patch to fix it. Please review.
>
> --
> Cyril Hrubis
> [email protected]
--
Han Pingtian
Quality Engineer
hpt @ #kernel-qe
Red Hat, Inc
Freedom ... courage ... Commitment ... ACCOUNTABILITY
>From 88a2b632e048fb137b6f88f6301eb379b733a294 Mon Sep 17 00:00:00 2001
From: Han Pingtian <[email protected]>
Date: Thu, 10 Mar 2011 12:25:47 +0800
Subject: [PATCH] set temp file's mode for mlock01 test
As Cyril point out, we should set the temp file's mode when O_CREAT is
specified within open().
Signed-off-by: Han Pingtian <[email protected]>
---
testcases/kernel/mem/mlock/mlock01.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/testcases/kernel/mem/mlock/mlock01.c
b/testcases/kernel/mem/mlock/mlock01.c
index 9218e0c..33b9194 100644
--- a/testcases/kernel/mem/mlock/mlock01.c
+++ b/testcases/kernel/mem/mlock/mlock01.c
@@ -62,7 +62,7 @@ static void setup(void)
{
tst_tmpdir();
- fd = open(testfile, O_CREAT | O_RDWR);
+ fd = open(testfile, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR);
if (fd == -1)
tst_brkm(TBROK|TERRNO, cleanup, "open");
--
1.7.1
------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list