From: chrubis@suse.cz
To: Jungsoo Son <jungsoo.son@lge.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH] syscalls/chmod02: Fix wrong address of buf for write()
Date: Wed, 5 Jun 2013 17:32:05 +0200 [thread overview]
Message-ID: <20130605153204.GA611@rei> (raw)
In-Reply-To: <009401ce6193$609aaf40$21d00dc0$@lge.com>
Hi!
> Signed-off-by: jungsoo.son <jungsoo.son@lge.com>
> ---
> testcases/kernel/syscalls/chmod/chmod02.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/testcases/kernel/syscalls/chmod/chmod02.c
> b/testcases/kernel/syscalls/chmod/chmod02.c
> index 242cbd3..904c5e8 100644
> --- a/testcases/kernel/syscalls/chmod/chmod02.c
> +++ b/testcases/kernel/syscalls/chmod/chmod02.c
> @@ -187,9 +187,9 @@ void setup()
> if ((fd = open(fname, O_RDWR | O_CREAT, 0700)) == -1) {
> tst_brkm(TBROK | TERRNO, cleanup,
> "open(%s, O_RDWR|O_CREAT,0700) failed", fname);
> - } else if (write(fd, &buf, strlen(buf)) == -1) {
> + } else if (write(fd, buf, strlen(buf)) == -1) {
> tst_brkm(TBROK | TERRNO, cleanup,
> - "write(%s, &buf, strlen(buf)) failed", fname);
> + "write(%s, buf, strlen(buf)) failed", fname);
> } else if (close(fd) == -1) {
> tst_brkm(TBROK | TERRNO, cleanup, "close(%s) failed",
> fname);
I've replaced the the code that creates the file with single
SAFE_FILE_PRINTF(). Thanks for the report.
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
prev parent reply other threads:[~2013-06-05 15:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-05 2:21 [LTP] [PATCH] syscalls/chmod02: Fix wrong address of buf for write() Jungsoo Son
2013-06-05 15:32 ` 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=20130605153204.GA611@rei \
--to=chrubis@suse.cz \
--cc=jungsoo.son@lge.com \
--cc=ltp-list@lists.sourceforge.net \
/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