From: Chris Hanson Date: Tue, 15 Aug 1989 07:15:47 +0000 (+0000) Subject: Bug report from Jinx: `prealloc' may change the file pointer, so the X-Git-Tag: 20090517-FFI~11826 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=7e708ba9f1ab9e791f06e22e6f04340f3f3c613f;p=mit-scheme.git Bug report from Jinx: `prealloc' may change the file pointer, so the hp-ux code that uses it must check. --- diff --git a/v7/src/microcode/bchmmg.c b/v7/src/microcode/bchmmg.c index 156e16b13..e7f72f2c7 100644 --- a/v7/src/microcode/bchmmg.c +++ b/v7/src/microcode/bchmmg.c @@ -30,7 +30,7 @@ Technology nor of any adaptation thereof in any advertising, promotional, or sales literature without prior written consent from MIT in each case. */ -/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/bchmmg.c,v 9.45 1989/06/08 00:23:58 jinx Rel $ */ +/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/bchmmg.c,v 9.46 1989/08/15 07:15:47 cph Exp $ */ /* Memory management top level. Garbage collection to disk. @@ -155,9 +155,8 @@ open_gc_file(size) continue; } fprintf(stderr, - "%s: GC file \"%s\" cannot be opened; ", - Saved_argv[0]), gc_file_name; - fprintf(stderr, "Aborting.\n"); + "%s: GC file \"%s\" cannot be opened; Aborting.\n", + Saved_argv[0], gc_file_name); exit(1); } #ifdef hpux @@ -165,6 +164,14 @@ open_gc_file(size) { extern prealloc(); prealloc(gc_file, size); + /* Prealloc may change (it does under 6.5) the file pointer! */ + if ((lseek(gc_file, 0, 0)) == -1) + { + fprintf(stderr, + "%s: cannot position at start of GC file \"%s\"; Aborting.\n", + Saved_argv[0], gc_file_name); + exit(1); + } } #endif current_disk_position = 0;