1: # include   "../ingres.h"
   2: # include   "../access.h"
   3: 
   4: /*
   5: closer - close a relation
   6: DESCRIPTION
   7: 
   8: CLOSER is used to close a relation which was opened by OPENR.
   9: CLOSER should always be called once for each OPENR.
  10: 
  11: 	function values:
  12: 
  13: 		<0  fatal error
  14: 		 0  success
  15: 		 1  relation was not open
  16:  */
  17: 
  18: 
  19: closer(d)
  20: struct descriptor   *d;
  21: {
  22:     register struct descriptor  *dx;
  23:     register int            i;
  24:     register struct accbuf      *b;
  25: 
  26:     dx = d;
  27: #	ifdef xATR1
  28:     if (tTf(90, 8))
  29:         printf("closer: %.14s,%s\n", dx->relid, locv(dx->reladds));
  30: #	endif
  31: 
  32:     if (i = noclose(dx))
  33:         return (i);
  34: 
  35:     flush_rel(dx, TRUE);    /* No error is possible since noclose()
  36: 				** has already flushed any pages
  37: 				*/
  38: 
  39:     if (close(dx->relfp))   /*close the relation*/
  40:         i = acc_err(AMCLOSE_ERR);
  41: 
  42:     dx->relopn = 0;
  43:     return (i);
  44: }
Last modified: 1980-12-17
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 2226
Valid CSS Valid XHTML 1.0 Strict