linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] selftests: check that execveat returns negative values in case of errors
@ 2015-03-13 20:19 Andrey Vagin
  0 siblings, 0 replies; only message in thread
From: Andrey Vagin @ 2015-03-13 20:19 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andrey Vagin, Shuah Khan

Currently we check that execveat returns non-positive value
when an error is expected. But we need to check that execveat() doesn't
return zero in such cases too.

Cc: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
---
 tools/testing/selftests/exec/execveat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/exec/execveat.c b/tools/testing/selftests/exec/execveat.c
index e238c95..6747a3f 100644
--- a/tools/testing/selftests/exec/execveat.c
+++ b/tools/testing/selftests/exec/execveat.c
@@ -47,7 +47,7 @@ static int _check_execveat_fail(int fd, const char *path, int flags,
 		fd, path?:"(null)", flags, errno_str);
 	rc = execveat_(fd, path, argv, envp, flags);
 
-	if (rc > 0) {
+	if (rc >= 0) {
 		printf("[FAIL] (unexpected success from execveat(2))\n");
 		return 1;
 	}
-- 
2.1.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-03-13 20:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-13 20:19 [PATCH] selftests: check that execveat returns negative values in case of errors Andrey Vagin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).