ftest06.c: fix a bug of using option -i
PATCH 1/1 ftest06.c: fix a bug of using option -i
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 <[email protected]>
--- testcases/kernel/fs/ftest/ftest06.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
testcases/kernel/fs/ftest/ftest06.c +2 -2
@@ -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);
Signature · 16 lines
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 [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
Hi!
Quoted 5 lines
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!
Signature · 12 lines
Cyril Hrubis [email protected] ------------------------------------------------------------------------------ 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