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