cvsuser     04/10/01 01:46:51

  Modified:    io       io.c io_passdown.c
  Log:
  io flush_down fixe
  * PIO_flush_down did only flush the top IO layer
  * now fsync or fflush is called too
  * changed comment in PIO_finish
  
  Revision  Changes    Path
  1.104     +21 -20    parrot/io/io.c
  
  Index: io.c
  ===================================================================
  RCS file: /cvs/public/parrot/io/io.c,v
  retrieving revision 1.103
  retrieving revision 1.104
  diff -u -w -r1.103 -r1.104
  --- io.c      9 Aug 2004 14:51:02 -0000       1.103
  +++ io.c      1 Oct 2004 08:46:50 -0000       1.104
  @@ -1,6 +1,6 @@
   /*
   Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
  -$Id: io.c,v 1.103 2004/08/09 14:51:02 leo Exp $
  +$Id: io.c,v 1.104 2004/10/01 08:46:50 leo Exp $
   
   =head1 NAME
   
  @@ -299,33 +299,34 @@
   void
   PIO_finish(theINTERP)
   {
  -    ParrotIOLayer *p, *down;
  +    ParrotIOLayer *layer, *down;
   #if 0
  +    PMC *pmc;
       ParrotIO *io;
       int i;
  -#endif
  -
  -    /* XXX is this all correct? */
  -
  -    fflush(stdout);
  -    fflush(stderr);
  -
  -#if 0
  -    /* new_io_pmc isn't possible aynmore  - mem subsystem is down already */
  -
  -    /* TODO: close std descriptors */
   
  +    /* When here, the PMC arena is already destructed, these PMCs
  +     * aren't usable any more.
  +     * But ParrotIO::destroy should have flushed/closed all PIOs
  +     * already. If that's not quite true, we have to separate IO subsys
  +     * destruction into two parts (again).
  +     */
       for (i = 0 ; i < PIO_NR_OPEN; i++) {
  -        if ( (io = interpreter->piodata->table[i]) ) {
  -            PIO_close(interpreter, new_io_pmc(interpreter, io));
  +        if ( (pmc = interpreter->piodata->table[i]) ) {
  +            layer = PMC_struct_val(pmc);
  +            io = PMC_data(pmc);
  +            PIO_close_down(interpreter, layer, io);
           }
       }
   #endif
  -    for (p = interpreter->piodata->default_stack; p; ) {
  -        down = p->down;
  -        if (p->api->Delete)
  -            (*p->api->Delete) (p);
  -        p = down;
  +    /*
  +     * TODO free IO of std-handles
  +     */
  +    for (layer = interpreter->piodata->default_stack; layer; ) {
  +        down = layer->down;
  +        if (layer->api->Delete)
  +            (*layer->api->Delete) (layer);
  +        layer = down;
       }
       mem_sys_free(interpreter->piodata->table);
       mem_sys_free(interpreter->piodata);
  
  
  
  1.9       +2 -2      parrot/io/io_passdown.c
  
  Index: io_passdown.c
  ===================================================================
  RCS file: /cvs/public/parrot/io/io_passdown.c,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -w -r1.8 -r1.9
  --- io_passdown.c     21 Jun 2004 15:56:08 -0000      1.8
  +++ io_passdown.c     1 Oct 2004 08:46:50 -0000       1.9
  @@ -1,6 +1,6 @@
   /*
   Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
  -$Id: io_passdown.c,v 1.8 2004/06/21 15:56:08 leo Exp $
  +$Id: io_passdown.c,v 1.9 2004/10/01 08:46:50 leo Exp $
   
   =head1 NAME
   
  @@ -283,7 +283,7 @@
   {
       while (layer) {
           if (layer->api->Flush) {
  -            return layer->api->Flush(interpreter, layer, io);
  +            layer->api->Flush(interpreter, layer, io);
           }
           layer = PIO_DOWNLAYER(layer);
       }
  
  
  

Reply via email to