diff mbox series

[COMMITTED] syscalls/fstat03: Fix bad fd initialization

Message ID 20190919085856.18758-1-chrubis@suse.cz
State Accepted
Delegated to: Petr Vorel
Headers show
Series [COMMITTED] syscalls/fstat03: Fix bad fd initialization | expand

Commit Message

Cyril Hrubis Sept. 19, 2019, 8:58 a.m. UTC
passing unused pid as bad fd is wrong and slipped in during a review.

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
 testcases/kernel/syscalls/fstat/fstat03.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/testcases/kernel/syscalls/fstat/fstat03.c b/testcases/kernel/syscalls/fstat/fstat03.c
index acefa2529..68fae43df 100644
--- a/testcases/kernel/syscalls/fstat/fstat03.c
+++ b/testcases/kernel/syscalls/fstat/fstat03.c
@@ -25,7 +25,7 @@ 
 #define TESTFILE	"test_file"
 
 static int fd_ok;
-static int fd_ebadf;
+static int fd_ebadf = -1;
 static struct stat stat_buf;
 
 static struct tcase {
@@ -83,7 +83,6 @@  static void run(unsigned int tc_num)
 
 static void setup(void)
 {
-	fd_ebadf = tst_get_unused_pid();
 	fd_ok = SAFE_OPEN(TESTFILE, O_RDWR | O_CREAT, 0644);
 }