summaryrefslogtreecommitdiffstats
path: root/src/sandbox/problems/libsandbox_muttbug.c
diff options
context:
space:
mode:
authorJason Stubbs <jstubbs@gentoo.org>2005-08-28 08:37:44 +0000
committerJason Stubbs <jstubbs@gentoo.org>2005-08-28 08:37:44 +0000
commitd9fc4acc572c6647a4f27b838d35d27d805d190e (patch)
tree262a8de35d8c7567312757da5f1f66efdc8cece5 /src/sandbox/problems/libsandbox_muttbug.c
downloadportage-d9fc4acc572c6647a4f27b838d35d27d805d190e.tar.gz
portage-d9fc4acc572c6647a4f27b838d35d27d805d190e.tar.bz2
portage-d9fc4acc572c6647a4f27b838d35d27d805d190e.zip
Migration (without history) of the current stable line to subversion.
svn path=/main/branches/2.0/; revision=1941
Diffstat (limited to 'src/sandbox/problems/libsandbox_muttbug.c')
-rw-r--r--src/sandbox/problems/libsandbox_muttbug.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/sandbox/problems/libsandbox_muttbug.c b/src/sandbox/problems/libsandbox_muttbug.c
new file mode 100644
index 000000000..1d6e18c48
--- /dev/null
+++ b/src/sandbox/problems/libsandbox_muttbug.c
@@ -0,0 +1,24 @@
+/* $Header: /var/cvsroot/gentoo-src/portage/src/sandbox/problems/Attic/libsandbox_muttbug.c,v 1.2 2003/03/22 14:24:38 carpaski Exp $ */
+
+#define _GNU_SOURCE
+#define _REENTRANT
+
+#define open xxx_open
+#include <dlfcn.h>
+#include <errno.h>
+#include <stdio.h>
+#undef open
+
+extern FILE* fopen(const char*, const char*);
+FILE* (*orig_fopen)(const char*, const char*) = 0;
+FILE* fopen(const char* a1, const char* a2)
+{
+ int old_errno = errno;
+ if (!orig_fopen)
+ {
+ orig_fopen = dlsym(RTLD_NEXT, "fopen");
+ }
+ errno = old_errno;
+ return orig_fopen(a1, a2);
+}
+