public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* Re: [LTP] [PATCH] syscalls/chmod02: Fix wrong address of buf for write()
@ 2013-06-05  2:21 Jungsoo Son
  2013-06-05 15:32 ` chrubis
  0 siblings, 1 reply; 2+ messages in thread
From: Jungsoo Son @ 2013-06-05  2:21 UTC (permalink / raw)
  To: ltp-list


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);
 	}
-- 
1.7.9.5

> -----Original Message-----
> From: Jungsoo Son [mailto:jungsoo.son@lge.com]
> Sent: Wednesday, June 05, 2013 11:09 AM
> To: 'ltp-list@lists.sourceforge.net'
> Subject: [PATCH] syscalls/chmod02: Fix wrong address of buf as write()
> argument
> 
> 
> Signed-off-by: jungsoo.son <jungsoo.son@lge.com>
> ---
>  testcases/kernel/syscalls/chmod/chmod02.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/testcases/kernel/syscalls/chmod/chmod02.c
> b/testcases/kernel/syscalls/chmod/chmod02.c
> index 242cbd3..b1c331a 100644
> --- a/testcases/kernel/syscalls/chmod/chmod02.c
> +++ b/testcases/kernel/syscalls/chmod/chmod02.c
> @@ -187,7 +187,7 @@ 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);
>  	} else if (close(fd) == -1) {
> --
> 1.7.9.5


------------------------------------------------------------------------------
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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [LTP] [PATCH] syscalls/chmod02: Fix wrong address of buf for write()
  2013-06-05  2:21 [LTP] [PATCH] syscalls/chmod02: Fix wrong address of buf for write() Jungsoo Son
@ 2013-06-05 15:32 ` chrubis
  0 siblings, 0 replies; 2+ messages in thread
From: chrubis @ 2013-06-05 15:32 UTC (permalink / raw)
  To: Jungsoo Son; +Cc: ltp-list

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-06-05 15:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox