From: "Serge E. Hallyn" <serue@us.ibm.com>
To: Garrett Cooper <yanegomi@gmail.com>
Cc: LTP list <ltp-list@lists.sourceforge.net>
Subject: [LTP] [PATCH 3/4] mqns2: fix some error checking and reporting
Date: Wed, 28 Apr 2010 16:09:47 -0500 [thread overview]
Message-ID: <20100428210947.GB20642@us.ibm.com> (raw)
In-Reply-To: <20100428210906.GA20572@us.ibm.com>
Signed-off-by: Serge Hallyn <serue@us.ibm.com>
---
testcases/kernel/containers/mqns/mqns_02.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/testcases/kernel/containers/mqns/mqns_02.c b/testcases/kernel/containers/mqns/mqns_02.c
index 8f783ba..07ab042 100644
--- a/testcases/kernel/containers/mqns/mqns_02.c
+++ b/testcases/kernel/containers/mqns/mqns_02.c
@@ -76,7 +76,7 @@ int check_mqueue(void *vtest)
else {
- if (read(p1[0], buf, 5))
+ if (read(p1[0], buf, 5) < 0)
tst_resm(TBROK | TERRNO,
"read(p1[0], ..) failed");
else {
@@ -142,7 +142,7 @@ int main(int argc, char *argv[])
}
if (read(p2[0], buf, 7) < 0) {
- tst_resm(TBROK, "read(p1[0], ..) failed");
+ tst_resm(TBROK, "read(p2[0], ..) failed");
} else if (!strcmp(buf, "mqfail")) {
tst_resm(TFAIL, "child process could not create mqueue\n");
umount(DEV_MQUEUE);
@@ -160,8 +160,8 @@ int main(int argc, char *argv[])
tst_resm(TFAIL, "Parent process found mqueue\n");
mq_close(mqd);
}
- if (write(p1[1], "cont", 5)) {
- tst_resm(TBROK, "read(p1[0], ..) failed");
+ if (write(p1[1], "cont", 5) < 0) {
+ tst_resm(TBROK, "write(p1[1], ..) failed");
}
}
--
1.7.0
------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next prev parent reply other threads:[~2010-04-28 21:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-28 21:09 [LTP] [PATCH 1/4] mqns: strip leading / from mq names Serge E. Hallyn
2010-04-28 21:09 ` [LTP] [PATCH 2/4] pidns30: strip leading / from name passed to mq_open Serge E. Hallyn
2010-04-28 23:02 ` Garrett Cooper
2010-04-28 21:09 ` Serge E. Hallyn [this message]
2010-04-28 23:02 ` [LTP] [PATCH 3/4] mqns2: fix some error checking and reporting Garrett Cooper
2010-04-28 21:10 ` [LTP] [PATCH 4/4] mqns04.c: don't exit strangely in clone case (please read) Serge E. Hallyn
2010-04-28 23:04 ` [LTP] [PATCH 1/4] mqns: strip leading / from mq names Garrett Cooper
2010-04-29 0:29 ` Serge E. Hallyn
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=20100428210947.GB20642@us.ibm.com \
--to=serue@us.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox