From 2a51403518d956d4356a975a48d40d46d4c03156 Mon Sep 17 00:00:00 2001 From: ubu32 Date: Mon, 11 Jul 2011 21:15:15 -0700 Subject: [PATCH] fix restore of streams. --- packages/PLStream/pl-file.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/PLStream/pl-file.c b/packages/PLStream/pl-file.c index 2c6b44f68..20afd54eb 100755 --- a/packages/PLStream/pl-file.c +++ b/packages/PLStream/pl-file.c @@ -329,11 +329,14 @@ initIO() int i; #ifdef __YAP_PROLOG__ - IOFUNCTIONS buf; - buf = GD->os.iofunctions; + volatile IOFUNCTIONS buf; + buf = *Sinput->functions; memset(GD, 0, sizeof(gds_t)); - GD->os.iofunctions = buf; memset(LD, 0, sizeof(PL_local_data_t)); + GD->os.iofunctions = buf; + Sinput->functions = &GD->os.iofunctions; + Soutput->functions = &GD->os.iofunctions; + Serror->functions = &GD->os.iofunctions; #endif streamAliases = newHTable(16); streamContext = newHTable(16);