Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-7]: src/tests/lib/librumpclient Pull up following revision(s) (re...
details: https://anonhg.NetBSD.org/src/rev/c1d16103838b
branches: netbsd-7
changeset: 798685:c1d16103838b
user: martin <martin%NetBSD.org@localhost>
date: Tue Dec 09 20:23:14 2014 +0000
description:
Pull up following revision(s) (requested by gson in ticket #307):
tests/lib/librumpclient/h_execthr.c: revision 1.3
Update hardcoded fd expectations now that rump kernels open 0/1/2.
(since we exec, it's convenient to just assume the values of first 4 fds)
diffstat:
tests/lib/librumpclient/h_execthr.c | 21 +++++++++++++--------
1 files changed, 13 insertions(+), 8 deletions(-)
diffs (61 lines):
diff -r d81d98a29420 -r c1d16103838b tests/lib/librumpclient/h_execthr.c
--- a/tests/lib/librumpclient/h_execthr.c Tue Dec 09 20:21:05 2014 +0000
+++ b/tests/lib/librumpclient/h_execthr.c Tue Dec 09 20:23:14 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: h_execthr.c,v 1.2 2011/03/08 15:35:28 pooka Exp $ */
+/* $NetBSD: h_execthr.c,v 1.2.22.1 2014/12/09 20:23:14 martin Exp $ */
/*
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -51,6 +51,11 @@
*/
#define NTHR 63
+#define P1_0 3
+#define P1_1 4
+#define P2_0 5
+#define P2_1 6
+
static void *
wrk(void *arg)
{
@@ -110,14 +115,14 @@
if (execd) {
canreturn = 1;
if (pthread_create(&pt, NULL,
- wrk, (void *)(uintptr_t)2) != 0)
+ wrk, (void *)(uintptr_t)P2_0) != 0)
errx(1, "exec pthread_create");
i = 37;
- rump_sys_write(3, &i, sizeof(i));
+ rump_sys_write(P2_1, &i, sizeof(i));
pthread_join(pt, NULL);
- n = rump_sys_read(0, &i, sizeof(i));
+ n = rump_sys_read(P1_0, &i, sizeof(i));
if (n != -1 || errno != EBADF)
errx(1, "post-exec cloexec works");
@@ -129,17 +134,17 @@
if (execd > 10)
exit(0);
- rump_sys_close(2);
- rump_sys_close(3);
+ rump_sys_close(P2_0);
+ rump_sys_close(P2_1);
}
if (rump_sys_pipe(p1) == -1)
err(1, "pipe1");
- if (p1[0] != 0 || p1[1] != 1)
+ if (p1[0] != P1_0 || p1[1] != P1_1)
errx(1, "p1 assumptions failed %d %d", p1[0], p1[1]);
if (rump_sys_pipe(p2) == -1)
err(1, "pipe1");
- if (p2[0] != 2 || p2[1] != 3)
+ if (p2[0] != P2_0 || p2[1] != P2_1)
errx(1, "p2 assumptions failed");
if (rump_sys_fcntl(p1[0], F_SETFD, FD_CLOEXEC) == -1)
err(1, "cloexec");
Home |
Main Index |
Thread Index |
Old Index