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 #include "rmsgs.h"
13 #include "transmit.h"
14 
15 /*
16  * If *fpp is non-null, fclose it and check for errors.
17  * On error, call fulldisk(art, name).
18  */
19 void
nnfclose(art,fpp,name)20 nnfclose(art, fpp, name)
21 struct article *art;
22 register FILE **fpp;
23 const char *name;
24 {
25 	if (*fpp != NULL) {
26 		if (nfclose(*fpp) == EOF)
27 			fulldisk(art, name);
28 		*fpp = NULL;		/* mark the stream closed */
29 	}
30 }
31 
32 statust
synccaches()33 synccaches()			/* force dirty in-core caches to disk */
34 {
35 	return actsync() | trclose();
36 }
37