aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2012-03-05 16:19:08 -0500
committerMike Frysinger <vapier@gentoo.org>2012-03-05 16:21:47 -0500
commit5498907383c7f1654188b6a0d02d8b03112a28c3 (patch)
tree4d207926c2d4b5c63d36f6108149f170be510bce /src
parenttests: note that testsuite.list.at is generated (diff)
downloadsandbox-5498907383c7f1654188b6a0d02d8b03112a28c3.tar.gz
sandbox-5498907383c7f1654188b6a0d02d8b03112a28c3.tar.bz2
sandbox-5498907383c7f1654188b6a0d02d8b03112a28c3.zip
libsandbox: push down constructor init
Since every consumer of sb_open gets a copy of the sbio_open data, push the init of this into the .data section of the respective consumers to avoid the runtime overhead. This just leaves sandbox_lib setup in the constructor function, but that is only needed by the execve wrapper, so push down init of that to the existing sb_init logic which happens before our execve wrapper gets used. URL: http://bugs.gentoo.org/404013 Reported-by: Mike Gilbert <floppym@gentoo.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'src')
-rw-r--r--src/sandbox.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/sandbox.c b/src/sandbox.c
index d36126e..a8e28fe 100644
--- a/src/sandbox.c
+++ b/src/sandbox.c
@@ -18,6 +18,7 @@
static int print_debug = 0;
#define dprintf(fmt, args...) do { if (print_debug) printf(fmt, ## args); } while (0)
#define dputs(str) do { if (print_debug) puts(str); } while (0)
+int (*sbio_open)(const char *, int, mode_t) = (void *)open;
volatile static int stop_called = 0;
volatile static pid_t child_pid = 0;