Mis_APKBUILD/squeak-vm/sqVirtualMachine.patch
Victor Diego Alegandro Diaz Urbaneja 95c3a782ba Añadiedo APKBUILD de squeak-vm
2019-12-01 20:38:37 -04:00

50 lines
1.2 KiB
Diff

--- 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--];
}