summaryrefslogtreecommitdiff
path: root/repo/squeak-vm/sqVirtualMachine.patch
blob: 37b4699537de2f803f62764bf12d25973f0f253e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
--- a/Cross/vm/sqVirtualMachine.c
+++ b/Cross/vm/sqVirtualMachine.c
@@ -485,10 +485,7 @@
 /* This lives here for now but belongs somewhere else.
  * platforms/Cross/vm/sqStuff.c??
  */
-#define STDOUT_STACK_SZ 5
-static int stdoutStackIdx = -1;
-static FILE stdoutStack[STDOUT_STACK_SZ];
-
+ 
 /* N.B. As of cygwin 1.5.25 fopen("crash.dmp","a") DOES NOT WORK!  crash.dmp
  * contains garbled output as if the file pointer gets set to the start of the
  * file, not the end.  So we synthesize our own append mode.
@@ -521,10 +518,6 @@
 
 	FILE *output;
 
-	if (stdoutStackIdx + 2 >= STDOUT_STACK_SZ) {
-		fprintf(stderr,"output file stack is full.\n");
-		return;
-	}
 	switch ((unsigned)filenameOrStdioIndex) {
 	case STDOUT_FILENO: output = stdout; break;
 	case STDERR_FILENO: output = stderr; break;
@@ -536,17 +529,11 @@
 			return;
 		}
 	}
-	stdoutStack[++stdoutStackIdx] = *stdout;
-	*stdout = *output;
 }
 
 void
 popOutputFile()
 {
-	if (stdoutStackIdx < 0) {
-		fprintf(stderr,"output file stack is empty.\n");
-		return;
-	}
 	fflush(stdout);
 	if (fileno(stdout) > STDERR_FILENO) {
 		/* as of Feb 2011 with fclose@@GLIBC_2.1 under e.g. CentOS 5.3, fclose
@@ -558,5 +545,4 @@
 		fclose(stdout);
 #endif
 	}
-	*stdout = stdoutStack[stdoutStackIdx--];
 }