diff options
author | Jason Stubbs <jstubbs@gentoo.org> | 2005-08-28 08:37:44 +0000 |
---|---|---|
committer | Jason Stubbs <jstubbs@gentoo.org> | 2005-08-28 08:37:44 +0000 |
commit | d9fc4acc572c6647a4f27b838d35d27d805d190e (patch) | |
tree | 262a8de35d8c7567312757da5f1f66efdc8cece5 /src/sandbox/problems/libsandbox_emacsbug.c | |
download | portage-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_emacsbug.c')
-rw-r--r-- | src/sandbox/problems/libsandbox_emacsbug.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/sandbox/problems/libsandbox_emacsbug.c b/src/sandbox/problems/libsandbox_emacsbug.c new file mode 100644 index 000000000..11e861b92 --- /dev/null +++ b/src/sandbox/problems/libsandbox_emacsbug.c @@ -0,0 +1,34 @@ +/* $Header: /var/cvsroot/gentoo-src/portage/src/sandbox/problems/Attic/libsandbox_emacsbug.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 <fcntl.h> +# include <stdlib.h> +# include <sys/stat.h> +# include <sys/types.h> +#undef open + +extern int open(const char*, int, mode_t); +int (*orig_open)(const char*, int, mode_t) = NULL; +int open(const char* pathname, int flags, mode_t mode) +{ + int old_errno = errno; + + /* code that makes xemacs' compilation produce a segfaulting executable */ +/* char** test = NULL; + test = (char**)malloc(sizeof(char*)); + free(test);*/ + /* end of that code */ + + if (!orig_open) + { + orig_open = dlsym(RTLD_NEXT, "open"); + } + errno = old_errno; + return orig_open(pathname, flags, mode); +} + |