Skip to contentSkip to conversation

testcases: syscall: readlink: fix except return val

PATCH In review Bob Liu 2 participants 2 messages May 12, 2011 – May 31, 2011

lore
Share & tools
lore

Bob Liu

author
#0 lore raw

PATCH 1/1 testcases: syscall: readlink: fix except return val

This kernel commit "readlinkat(), fchownat() and fstatat() with empty relative pathnames"(65cfc6722361570bfe255698d9cd4dccaf47570d) broken POSIX scope which makes readlink03 fail like this:

readlink03 1 TFAIL : readlink() failed, Symlink Pathname is empty,
errno=22, expected errno=2

This patch fix the except return val from -ENOENT to -EINVAL.

---
 testcases/kernel/syscalls/readlink/readlink03.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
testcases/kernel/syscalls/readlink/readlink03.c +1 -1
index 0535b25..dbc20e6 100644
@@ -132,7 +132,7 @@ struct test_case_t {		/* test case struct. to hold ref. test cond's */
 	TEST_FILE2, "File is not symbolic link", EINVAL, 1, no_setup}, {
 	Longpathname, "Symlink path too long", ENAMETOOLONG, 1, lpath_setup},
 	{
-	"", "Symlink Pathname is empty", ENOENT, 1, no_setup}, {
+	"", "Symlink Pathname is empty", EINVAL, 1, no_setup}, {
 	NULL, NULL, 0, 0, no_setup}
 };
 
Signature · 14 lines
1.6.3.3



------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#1 lore raw

Hi!

Quoted 19 lines

This kernel commit "readlinkat(), fchownat() and fstatat() with empty relative pathnames"(65cfc6722361570bfe255698d9cd4dccaf47570d) broken POSIX scope which makes readlink03 fail like this:

readlink03 1 TFAIL : readlink() failed, Symlink Pathname is empty,
errno=22, expected errno=2

This patch fix the except return val from -ENOENT to -EINVAL.

---
 testcases/kernel/syscalls/readlink/readlink03.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
testcases/kernel/syscalls/readlink/readlink03.c +0 -0
index 0535b25..dbc20e6 100644

testcases/kernel/syscalls/readlink/readlink03.c struct test_case_t { /* test case struct. to hold ref. test cond's */ · line 137

Quoted 7 lines
testcases/kernel/syscalls/readlink/readlink03.c +1 -1
@@ -132,7 +132,7 @@ struct test_case_t {		/* test case struct. to hold ref. test cond's */
 	TEST_FILE2, "File is not symbolic link", EINVAL, 1, no_setup}, {
 	Longpathname, "Symlink path too long", ENAMETOOLONG, 1, lpath_setup},
 	{
-	"", "Symlink Pathname is empty", ENOENT, 1, no_setup}, {
+	"", "Symlink Pathname is empty", EINVAL, 1, no_setup}, {
 	NULL, NULL, 0, 0, no_setup}
 };

Same as previous one. Please make sure this doesn't break the test on older kernels.

Signature · 13 lines
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger. 
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today. 
http://p.sf.net/sfu/quest-sfdev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list