public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP]  [PATCH] ftest06.c: fix a bug of using option -i
@ 2011-03-12 10:07 Peng Haitao
  2011-03-16 12:43 ` Cyril Hrubis
  0 siblings, 1 reply; 2+ messages in thread
From: Peng Haitao @ 2011-03-12 10:07 UTC (permalink / raw)
  To: Garrett Cooper; +Cc: ltp-list


When using option -i, the case will print the following error message:
# ./ftest06 -i 2
ftest06     1  TPASS  :  Test passed.
ftest06     2  TFAIL  :         Can't chdir(/tmp/fteBX4U5O/ftest06.7461/tmp/fteBX4U5O/ftest06.7461): errno=ENOENT(2): No such file or directory

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
---
 testcases/kernel/fs/ftest/ftest06.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/testcases/kernel/fs/ftest/ftest06.c b/testcases/kernel/fs/ftest/ftest06.c
index 18eae5d..d59a18f 100644
--- a/testcases/kernel/fs/ftest/ftest06.c
+++ b/testcases/kernel/fs/ftest/ftest06.c
@@ -140,10 +140,10 @@ int main(int ac, char *av[])
 			}
 		}
 		cwd = startdir;
-		strcat(dirname, cwd);
+		strcpy(dirname, cwd);
 		sprintf(tmpname, "/ftest06.%d", getpid());
 		strcat(dirname, tmpname);
-		strcat(homedir, cwd);
+		strcpy(homedir, cwd);
 		sprintf(tmpname, "/ftest06h.%d", getpid());
 		strcat(homedir, tmpname);
 
-- 
1.7.1

-- 
Best Regards,
Peng Haitao


------------------------------------------------------------------------------
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
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] ftest06.c: fix a bug of using option -i
  2011-03-12 10:07 [LTP] [PATCH] ftest06.c: fix a bug of using option -i Peng Haitao
@ 2011-03-16 12:43 ` Cyril Hrubis
  0 siblings, 0 replies; 2+ messages in thread
From: Cyril Hrubis @ 2011-03-16 12:43 UTC (permalink / raw)
  To: Peng Haitao; +Cc: ltp-list

Hi!
> When using option -i, the case will print the following error message:
> # ./ftest06 -i 2
> ftest06     1  TPASS  :  Test passed.
> ftest06     2  TFAIL  :         Can't chdir(/tmp/fteBX4U5O/ftest06.7461/tmp/fteBX4U5O/ftest06.7461): errno=ENOENT(2): No such file or directory
> 

I've commited a little different patch that replaces the the strcat()'s
and strcpy()'s with single snprintf().

Thanks!
-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
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
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:[~2011-03-16 12:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-12 10:07 [LTP] [PATCH] ftest06.c: fix a bug of using option -i Peng Haitao
2011-03-16 12:43 ` Cyril Hrubis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox