Module Name: src Committed By: martin Date: Tue Dec 9 20:23:14 UTC 2014
Modified Files: src/tests/lib/librumpclient [netbsd-7]: h_execthr.c Log Message: 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) To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.2.22.1 src/tests/lib/librumpclient/h_execthr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/tests/lib/librumpclient/h_execthr.c diff -u src/tests/lib/librumpclient/h_execthr.c:1.2 src/tests/lib/librumpclient/h_execthr.c:1.2.22.1 --- src/tests/lib/librumpclient/h_execthr.c:1.2 Tue Mar 8 15:35:28 2011 +++ src/tests/lib/librumpclient/h_execthr.c Tue Dec 9 20:23:14 2014 @@ -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 @@ static int canreturn = 0; */ #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 @@ main(int argc, char *argv[], char *envp[ 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 @@ main(int argc, char *argv[], char *envp[ 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");