home *** CD-ROM | disk | FTP | other *** search
/ Unix System Administration Handbook 1997 October / usah_oct97.iso / news / cnews.tar / relay / io.c < prev    next >
C/C++ Source or Header  |  1994-01-31  |  583b  |  35 lines

  1. /*
  2.  * common i/o operations
  3.  */
  4.  
  5. #include <stdio.h>
  6. #include <sys/types.h>
  7. #include "news.h"
  8. #include "headers.h"
  9. #include "relay.h"
  10. #include "msgs.h"
  11. #include "active.h"
  12.  
  13. /*
  14.  * If *fpp is non-null, fclose it and check for errors.
  15.  * On error, call fulldisk(art, name).
  16.  */
  17. void
  18. nnfclose(art, fpp, name)
  19. struct article *art;
  20. register FILE **fpp;
  21. char *name;
  22. {
  23.     if (*fpp != NULL) {
  24.         if (nfclose(*fpp) == EOF)
  25.             fulldisk(art, name);
  26.         *fpp = NULL;        /* mark the stream closed */
  27.     }
  28. }
  29.  
  30. statust
  31. synccaches()            /* force dirty in-core caches to disk */
  32. {
  33.     return actsync() | trclose();
  34. }
  35.