public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] syscalls/fcntl35.c: fix wrong fds[0] && cleanup
@ 2017-06-16  7:57 Xiao Yang
  2017-06-19 14:43 ` Cyril Hrubis
  0 siblings, 1 reply; 2+ messages in thread
From: Xiao Yang @ 2017-06-16  7:57 UTC (permalink / raw)
  To: ltp

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
 testcases/kernel/syscalls/fcntl/fcntl35.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/testcases/kernel/syscalls/fcntl/fcntl35.c b/testcases/kernel/syscalls/fcntl/fcntl35.c
index 087e779..b984584 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl35.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl35.c
@@ -46,7 +46,7 @@
 
 static int pipe_max_unpriv;
 static int test_max_unpriv = 4096;
-struct passwd *pw;
+static struct passwd *pw;
 static struct tcase {
 	int exp_sz;
 	int exp_usr;
@@ -78,7 +78,7 @@ static void cleanup(void)
 static int verify_pipe_size(int exp_pip_sz, char *desp)
 {
 	int get_size;
-	int fds[0];
+	int fds[2];
 
 	SAFE_PIPE(fds);
 
@@ -109,11 +109,9 @@ end:
 
 static void do_test(unsigned int n)
 {
-	pid_t pid;
 	struct tcase *tc = &tcases[n];
 
-	pid = SAFE_FORK();
-	if (!pid) {
+	if (!SAFE_FORK()) {
 		if (tc->exp_usr)
 			SAFE_SETUID(pw->pw_uid);
 
-- 
1.8.3.1




^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [LTP] [PATCH] syscalls/fcntl35.c: fix wrong fds[0] && cleanup
  2017-06-16  7:57 [LTP] [PATCH] syscalls/fcntl35.c: fix wrong fds[0] && cleanup Xiao Yang
@ 2017-06-19 14:43 ` Cyril Hrubis
  0 siblings, 0 replies; 2+ messages in thread
From: Cyril Hrubis @ 2017-06-19 14:43 UTC (permalink / raw)
  To: ltp

Hi!
Pushed, thanks.

-- 
Cyril Hrubis
chrubis@suse.cz

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-06-19 14:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-16  7:57 [LTP] [PATCH] syscalls/fcntl35.c: fix wrong fds[0] && cleanup Xiao Yang
2017-06-19 14:43 ` Cyril Hrubis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox