Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-6]: src/lib/librumphijack Pull up following revision(s) (requeste...
details: https://anonhg.NetBSD.org/src/rev/3c955cde70ea
branches: netbsd-6
changeset: 774019:3c955cde70ea
user: riz <riz%NetBSD.org@localhost>
date: Thu Apr 19 20:06:21 2012 +0000
description:
Pull up following revision(s) (requested by martin in ticket #188):
lib/librumphijack/hijack.c: revision 1.92
poll(), pollts() and select() all return int values, but in the hijack
emulation of them these get passed as exit values from a pthread as
a void* (c.f. pthread_join(), pthread_exit()).
Do not use the address of an int variable for these, but provide the address
of a void* and assign the value afterwards.
Fixes hijacking of pollts/select on 64bit big endian hosts.
Spotted by and fix from pooka.
diffstat:
lib/librumphijack/hijack.c | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diffs (48 lines):
diff -r 8b285edc8311 -r 3c955cde70ea lib/librumphijack/hijack.c
--- a/lib/librumphijack/hijack.c Thu Apr 19 20:04:37 2012 +0000
+++ b/lib/librumphijack/hijack.c Thu Apr 19 20:06:21 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hijack.c,v 1.91 2012/02/01 05:34:41 dholland Exp $ */
+/* $NetBSD: hijack.c,v 1.91.2.1 2012/04/19 20:06:21 riz Exp $ */
/*-
* Copyright (c) 2011 Antti Kantee. All Rights Reserved.
@@ -29,7 +29,7 @@
#undef _FORTIFY_SOURCE
#include <sys/cdefs.h>
-__RCSID("$NetBSD: hijack.c,v 1.91 2012/02/01 05:34:41 dholland Exp $");
+__RCSID("$NetBSD: hijack.c,v 1.91.2.1 2012/04/19 20:06:21 riz Exp $");
#include <sys/param.h>
#include <sys/types.h>
@@ -1654,7 +1654,7 @@
parg->errnum = errno;
rump_sys_write(parg->pipefd, &rv, sizeof(rv));
- return (void *)(intptr_t)rv;
+ return (void *)rv;
}
int
@@ -1676,8 +1676,8 @@
struct pollfd *pfd_host = NULL, *pfd_rump = NULL;
int rpipe[2] = {-1,-1}, hpipe[2] = {-1,-1};
struct pollarg parg;
- uintptr_t lrv;
- int sverrno = 0, trv;
+ void *trv_val;
+ int sverrno = 0, lrv, trv;
/*
* ok, this is where it gets tricky. We must support
@@ -1770,7 +1770,8 @@
lrv = op_pollts(pfd_rump, nfds+1, ts, NULL);
sverrno = errno;
write(hpipe[1], &rv, sizeof(rv));
- pthread_join(pt, (void *)&trv);
+ pthread_join(pt, &trv_val);
+ trv = (int)(intptr_t)trv_val;
/* check who "won" and merge results */
if (lrv != 0 && pfd_host[nfds].revents & POLLIN) {
Home |
Main Index |
Thread Index |
Old Index