Skip to contentSkip to conversation

syscalls/fstat03: Fix bad fd initialization

PATCH New Cyril Hrubis 1 participant 1 message Sep 19, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 syscalls/fstat03: Fix bad fd initialization

passing unused pid as bad fd is wrong and slipped in during a review.

---
 testcases/kernel/syscalls/fstat/fstat03.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
testcases/kernel/syscalls/fstat/fstat03.c +1 -2
index acefa2529..68fae43df 100644
@@ -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);
 }
 
Signature · 1 line
2.21.0