summaryrefslogtreecommitdiffstats
path: root/src/sandbox/problems
diff options
context:
space:
mode:
Diffstat (limited to 'src/sandbox/problems')
-rw-r--r--src/sandbox/problems/Makefile31
-rw-r--r--src/sandbox/problems/libsandbox_emacsbug.c34
-rw-r--r--src/sandbox/problems/libsandbox_muttbug.c24
-rw-r--r--src/sandbox/problems/sandbox_dev_fd_foo.c42
-rw-r--r--src/sandbox/problems/sandbox_muttbug.c43
5 files changed, 0 insertions, 174 deletions
diff --git a/src/sandbox/problems/Makefile b/src/sandbox/problems/Makefile
deleted file mode 100644
index e24710826..000000000
--- a/src/sandbox/problems/Makefile
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright (C) 2001 Geert Bevin, Uwyn, http://www.uwyn.com
-# Distributed under the terms of the GNU General Public License, v2 or later
-# Author : Geert Bevin <gbevin@uwyn.com>
-#
-# Modified 15 Apr 2002 Jon Nelson <jnelson@gentoo.org>
-# Clean up Makefile somewhat, and use make's implicit rules
-#
-# $Id: /var/cvsroot/gentoo-src/portage/src/sandbox/problems/Attic/Makefile,v 1.2 2002/04/16 01:06:55 jnelson Exp $
-
-.SUFFIXES:
-.SUFFIXES: .c .o .so
-.PRECIOUS: %.o
-
-%.so: LIBS=-ldl
-%.so: LDFLAGS=--shared
-%.so: %.o
- $(CC) $(CFLAGS) $(CPPFLAGS) $< -o $@ $(LIBS) $(LDFLAGS)
-
-CC = gcc
-CFLAGS = -Wall -O2
-LIBS =
-LDFLAGS =
-
-TARGETS = sandbox_muttbug sandbox_dev_fd_foo \
- libsandbox_muttbug.so libsandbox_emacsbug.so
-
-all: $(TARGETS)
-
-clean:
- rm -f $(TARGETS)
- rm -f *.o *~
diff --git a/src/sandbox/problems/libsandbox_emacsbug.c b/src/sandbox/problems/libsandbox_emacsbug.c
deleted file mode 100644
index 0742bcdc1..000000000
--- a/src/sandbox/problems/libsandbox_emacsbug.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* $Id: /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);
-}
-
diff --git a/src/sandbox/problems/libsandbox_muttbug.c b/src/sandbox/problems/libsandbox_muttbug.c
deleted file mode 100644
index 08a798654..000000000
--- a/src/sandbox/problems/libsandbox_muttbug.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/* $Id: /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);
-}
-
diff --git a/src/sandbox/problems/sandbox_dev_fd_foo.c b/src/sandbox/problems/sandbox_dev_fd_foo.c
deleted file mode 100644
index 276f2ba6e..000000000
--- a/src/sandbox/problems/sandbox_dev_fd_foo.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/* $Id: /var/cvsroot/gentoo-src/portage/src/sandbox/problems/Attic/sandbox_dev_fd_foo.c,v 1.2 2003/03/22 14:24:38 carpaski Exp $ */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-void cleanup_1(void)
-{
- puts("Unlinking file...");
- unlink("/tmp/_sandbox_test.file");
-}
-
-int main(void)
-{
- struct stat s1, s2;
- FILE *fp1, *fp2;
- char *file = "/tmp/_sandbox_test.file";
- char devfd[32];
-
- printf("Opening file...\n");
- if (!(fp1 = fopen(file, "w")))
- exit(1);
- atexit(cleanup_1);
- printf("fstat'ing file...\n");
- if (fstat(fileno(fp1), &s1) < 0)
- exit(2);
- sprintf(devfd, "/dev/fd/%d", fileno(fp1));
- printf("fopening %s...\n", devfd);
- if (!(fp2 = fopen(devfd, "w")))
- exit(3);
- printf("fstat'ing %s...\n", devfd);
- if (fstat(fileno(fp2), &s2) < 0)
- exit(4);
- printf("Checking %ld == %ld and %ld == %ld...\n",
- (long int) s1.st_dev, (long int) s2.st_dev, s1.st_ino, s2.st_ino);
- if (s1.st_dev != s2.st_dev || s1.st_ino != s2.st_ino)
- exit(5);
- printf("Success!\n");
- return(0);
-}
diff --git a/src/sandbox/problems/sandbox_muttbug.c b/src/sandbox/problems/sandbox_muttbug.c
deleted file mode 100644
index a643f66aa..000000000
--- a/src/sandbox/problems/sandbox_muttbug.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/* $Id: /var/cvsroot/gentoo-src/portage/src/sandbox/problems/Attic/sandbox_muttbug.c,v 1.3 2003/03/22 14:24:38 carpaski Exp $ */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-int main(int argc, char *argv[])
-{
- FILE *fd ;
-
- printf("unlink\n");
- unlink("/tmp/test");
- printf("... done\n");
-
- printf("fopen\n");
- fd = fopen("/tmp/test", "a+");
- printf("... done\n");
-
- printf("fputc\n");
- fputc('7', fd);
- printf("... done\n");
-
- printf("fseek\n");
- fseek(fd, 0, SEEK_SET);
- printf("... done\n");
-
- printf("freopen\n");
- fd = freopen("/tmp/test", "r", fd);
- printf("... done\n");
-
- printf("fgetc ");
- printf("%c\n", fgetc(fd));
- printf("... done\n");
-
- printf("fseek\n");
- fseek(fd, 0, SEEK_SET);
- printf("... done\n");
-
- printf("fclose\n");
- fclose(fd);
- printf("... done\n");
- return 0;
-}