summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCamm Maguire <camm@debian.org>2014-04-17 16:20:25 +0000
committerCamm Maguire <camm@debian.org>2014-04-21 15:03:46 +0000
commited62498f042efc87366efb858596d46b0073956b (patch)
tree93b226eb0d87d816c4b6bac77b17c31cccae0a4f
parentbbe490e7e3b49c56e201ac93d92b2530462a9ca6 (diff)
downloadgcl-ed62498f042efc87366efb858596d46b0073956b.tar.gz
NO_SETUF for hppa workaround
-rwxr-xr-xgcl/h/386-bsd.h3
-rw-r--r--gcl/h/386-macosx.h3
-rwxr-xr-xgcl/h/OpenBSD.h3
-rwxr-xr-xgcl/h/gnuwin95.h2
-rwxr-xr-xgcl/h/hppa-linux.h2
-rw-r--r--gcl/h/linux.h3
-rwxr-xr-xgcl/h/mingw.h1
-rw-r--r--gcl/h/powerpc-macosx.h3
-rwxr-xr-xgcl/o/file.d25
-rwxr-xr-xgcl/o/sgbc.c2
10 files changed, 12 insertions, 35 deletions
diff --git a/gcl/h/386-bsd.h b/gcl/h/386-bsd.h
index 9ea9fb0d..777b9872 100755
--- a/gcl/h/386-bsd.h
+++ b/gcl/h/386-bsd.h
@@ -50,9 +50,6 @@
#endif
/* end listen for input */
-/* we dont need to worry about zeroing fp->_base , to prevent */
-#define FCLOSE_SETBUF_OK
-
#define DATA_BEGIN (char *)N_DATADDR(header);
#define UNIXSAVE "unexlin.c"
diff --git a/gcl/h/386-macosx.h b/gcl/h/386-macosx.h
index 3b71c2ed..d6447f45 100644
--- a/gcl/h/386-macosx.h
+++ b/gcl/h/386-macosx.h
@@ -174,9 +174,6 @@ do {int c=0; \
return(FALSE); \
} while (0)
-/* We (hopefully) dont need to worry about zeroing fp->_base. */
-#define FCLOSE_SETBUF_OK
-
#define GET_FULL_PATH_SELF(a_) \
do { \
extern int _NSGetExecutablePath (char *, unsigned long *); \
diff --git a/gcl/h/OpenBSD.h b/gcl/h/OpenBSD.h
index 72560d47..f2ab5aa8 100755
--- a/gcl/h/OpenBSD.h
+++ b/gcl/h/OpenBSD.h
@@ -19,9 +19,6 @@
#define I386
#define IEEEFLOAT
-/* we don't need to worry about zeroing fp->_base, to prevent what??? */
-#define FCLOSE_SETBUF_OK
-
/* #undef HAVE_XDR */
#define USE_ATT_TIME
diff --git a/gcl/h/gnuwin95.h b/gcl/h/gnuwin95.h
index 7badd313..c736a8eb 100755
--- a/gcl/h/gnuwin95.h
+++ b/gcl/h/gnuwin95.h
@@ -81,8 +81,6 @@ extern DBEGIN_TY _dbegin;
ungetc(i, fp); \
} while (0)
-#define FCLOSE_SETBUF_OK
-
#define RUN_PROCESS
#define IEEEFLOAT
diff --git a/gcl/h/hppa-linux.h b/gcl/h/hppa-linux.h
index b9821884..0b6111ba 100755
--- a/gcl/h/hppa-linux.h
+++ b/gcl/h/hppa-linux.h
@@ -18,3 +18,5 @@
#define RELOC_H "elf32_hppa_reloc.h"
#define SPECIAL_RELOC_H "elf32_hppa_reloc_special.h"
+
+#define NO_SETBUF /* FIXME, sgc setbuf instability */
diff --git a/gcl/h/linux.h b/gcl/h/linux.h
index c96214d7..af3cf2ec 100644
--- a/gcl/h/linux.h
+++ b/gcl/h/linux.h
@@ -109,9 +109,6 @@ do { int c = 0; \
&& (ioctl((fp)->_fileno, FIONREAD, &c),c<=0)) \
return 0;} while (0)
-/* we dont need to worry about zeroing fp->_base , to prevent */
-#define FCLOSE_SETBUF_OK
-
/* #define DATA_BEGIN((TXTRELOC+header.a_text+(SEGSIZ-1)) & ~(SEGSIZ-1)); */
#define DATA_BEGIN (char *)(char *)N_DATADDR(header);
diff --git a/gcl/h/mingw.h b/gcl/h/mingw.h
index b773d55d..993cd1a9 100755
--- a/gcl/h/mingw.h
+++ b/gcl/h/mingw.h
@@ -147,7 +147,6 @@ extern DBEGIN_TY _stacktop, _stackbottom, _dbegin;
ungetc(i, fp); \
} while (0)
-#define FCLOSE_SETBUF_OK
#define IEEEFLOAT
#define I386
diff --git a/gcl/h/powerpc-macosx.h b/gcl/h/powerpc-macosx.h
index 31b972ac..36f13cff 100644
--- a/gcl/h/powerpc-macosx.h
+++ b/gcl/h/powerpc-macosx.h
@@ -158,9 +158,6 @@ do {int c=0; \
return(FALSE); \
} while (0)
-/* We (hopefully) dont need to worry about zeroing fp->_base. */
-#define FCLOSE_SETBUF_OK
-
#define GET_FULL_PATH_SELF(a_) \
do { \
extern int _NSGetExecutablePath (char *, unsigned long *); \
diff --git a/gcl/o/file.d b/gcl/o/file.d
index ea4abbf1..569b59c6 100755
--- a/gcl/o/file.d
+++ b/gcl/o/file.d
@@ -367,34 +367,27 @@ BEGIN:
void
setup_stream_buffer(object x) {
-#ifndef NO_SETBUF
- char *buf=alloc_contblock(BUFSIZ);
- x->sm.sm_buffer = buf;
- setbuf(x->sm.sm_fp, buf);
+#ifdef NO_SETBUF
+ massert(!setvbuf(x->sm.sm_fp,x->sm.sm_buffer=NULL,_IONBF,0));
#else
- setvbuf(x->sm.sm_fp,NULL,_IONBF,0);
- x->sm.sm_buffer=0;
+ massert(!setvbuf(x->sm.sm_fp,x->sm.sm_buffer=alloc_contblock(BUFSIZ),_IOFBF,BUFSIZ));
#endif
}
static void
deallocate_stream_buffer(object strm) {
+ if (strm->sm.sm_buffer==NULL)
+ return;
+
/* SGC contblock pages: Its possible this is on an old page CM 20030827 */
- if (strm->sm.sm_buffer) {
#ifdef SGC
- insert_maybe_sgc_contblock(strm->sm.sm_buffer, BUFSIZ);
+ insert_maybe_sgc_contblock(strm->sm.sm_buffer,BUFSIZ);
#else
- insert_contblock(strm->sm.sm_buffer, BUFSIZ);
+ insert_contblock(strm->sm.sm_buffer,BUFSIZ);
#endif
- if (strm->sm.sm_fp)
- setvbuf(strm->sm.sm_fp,NULL,_IONBF,0);
- strm->sm.sm_buffer = 0;
- }
-#ifndef FCLOSE_SETBUF_OK
- strm->sm.sm_fp->_base = NULL;
-#endif
+ massert(!setvbuf(strm->sm.sm_fp,strm->sm.sm_buffer=NULL,_IONBF,0));
}
diff --git a/gcl/o/sgbc.c b/gcl/o/sgbc.c
index 1d405d76..0537879f 100755
--- a/gcl/o/sgbc.c
+++ b/gcl/o/sgbc.c
@@ -392,7 +392,7 @@ sgc_mark_object1(object x) {
sgc_mark_object(x->sm.sm_object1);
if (saving_system) {
FILE *fp = x->sm.sm_fp;
- if (fp != 0 && fp != stdin && fp !=stdout) {
+ if (fp != 0 /* && fp != stdin && fp !=stdout */) {
fclose(fp);
x->sm.sm_fp=0;
}