Blame SOURCES/strace-4.12-vhangup.patch

384337
commit cb44289ee3fd1482d3b8551d2e3b4568eb57e114
384337
Author: Dmitry V. Levin <ldv@altlinux.org>
384337
Date:   Tue Jul 26 10:20:24 2016 +0000
384337
384337
    tests: fix vhangup.test
384337
    
384337
    * tests/vhangup.c (main): Fix expected output for the case when
384337
    the calling process has CAP_SYS_TTY_CONFIG capability.
384337
    
384337
    Reported-by: Yun-Chih Chen <b03902074@ntu.edu.tw>
384337
384337
diff --git a/tests/vhangup.c b/tests/vhangup.c
384337
index ba90319..468f334 100644
384337
--- a/tests/vhangup.c
384337
+++ b/tests/vhangup.c
384337
@@ -13,7 +13,18 @@ main(void)
384337
 		perror_msg_and_skip("setsid");
384337
 
384337
 	long rc = syscall(__NR_vhangup);
384337
-	printf("vhangup() = %ld %s (%m)\n", rc, errno2name());
384337
+
384337
+	/*
384337
+	 * On setsid() success, the new session has no controlling terminal,
384337
+	 * therefore a subsequent vhangup() has nothing to hangup.
384337
+	 *
384337
+	 * The system call, however, returns 0 iff the calling process
384337
+	 * has CAP_SYS_TTY_CONFIG capability.
384337
+	 */
384337
+	if (rc)
384337
+		printf("vhangup() = %ld %s (%m)\n", rc, errno2name());
384337
+	else
384337
+		puts("vhangup() = 0");
384337
 
384337
 	puts("+++ exited with 0 +++");
384337
 	return 0;
384337
diff --git a/tests/vhangup.c b/tests/vhangup.c
384337
index ba90319..468f334 100644
384337
--- a/tests-m32/vhangup.c
384337
+++ b/tests-m32/vhangup.c
384337
@@ -13,7 +13,18 @@ main(void)
384337
 		perror_msg_and_skip("setsid");
384337
 
384337
 	long rc = syscall(__NR_vhangup);
384337
-	printf("vhangup() = %ld %s (%m)\n", rc, errno2name());
384337
+
384337
+	/*
384337
+	 * On setsid() success, the new session has no controlling terminal,
384337
+	 * therefore a subsequent vhangup() has nothing to hangup.
384337
+	 *
384337
+	 * The system call, however, returns 0 iff the calling process
384337
+	 * has CAP_SYS_TTY_CONFIG capability.
384337
+	 */
384337
+	if (rc)
384337
+		printf("vhangup() = %ld %s (%m)\n", rc, errno2name());
384337
+	else
384337
+		puts("vhangup() = 0");
384337
 
384337
 	puts("+++ exited with 0 +++");
384337
 	return 0;