From 79139fe8d882c39620b0d52ef081f639d1294917 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 10 Sep 2001 12:46:42 +0000 Subject: convert more code to use XFILE (This used to be commit fe6679dffba9a92bb35933ad52172c9be0e9ef90) --- source3/nmbd/nmbd_lmhosts.c | 2 +- source3/nmbd/nmbd_synclists.c | 8 ++++---- source3/nmbd/nmbd_winsserver.c | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'source3/nmbd') diff --git a/source3/nmbd/nmbd_lmhosts.c b/source3/nmbd/nmbd_lmhosts.c index 158988813b..04ab280784 100644 --- a/source3/nmbd/nmbd_lmhosts.c +++ b/source3/nmbd/nmbd_lmhosts.c @@ -36,7 +36,7 @@ void load_lmhosts_file(char *fname) pstring name; int name_type; struct in_addr ipaddr; - FILE *fp = startlmhosts( fname ); + XFILE *fp = startlmhosts( fname ); if (!fp) { DEBUG(2,("load_lmhosts_file: Can't open lmhosts file %s. Error was %s\n", diff --git a/source3/nmbd/nmbd_synclists.c b/source3/nmbd/nmbd_synclists.c index dea68d4c27..51c9257f5a 100644 --- a/source3/nmbd/nmbd_synclists.c +++ b/source3/nmbd/nmbd_synclists.c @@ -241,7 +241,7 @@ read the completed sync info **********************************************************************/ static void complete_sync(struct sync_record *s) { - FILE *f; + XFILE *f; fstring server, type_str; unsigned type; pstring comment; @@ -249,11 +249,11 @@ static void complete_sync(struct sync_record *s) char *ptr; int count=0; - f = sys_fopen(s->fname,"r"); + f = x_fopen(s->fname,O_RDONLY, 0); if (!f) return; - while (!feof(f)) { + while (!x_feof(f)) { if (!fgets_slash(line,sizeof(pstring),f)) continue; @@ -272,7 +272,7 @@ static void complete_sync(struct sync_record *s) count++; } - fclose(f); + x_fclose(f); unlink(s->fname); diff --git a/source3/nmbd/nmbd_winsserver.c b/source3/nmbd/nmbd_winsserver.c index 0ba1aef057..03d475133e 100644 --- a/source3/nmbd/nmbd_winsserver.c +++ b/source3/nmbd/nmbd_winsserver.c @@ -173,7 +173,7 @@ Load or create the WINS database. BOOL initialise_wins(void) { time_t time_now = time(NULL); - FILE *fp; + XFILE *fp; pstring line; if(!lp_we_are_a_wins_server()) @@ -181,14 +181,14 @@ BOOL initialise_wins(void) add_samba_names_to_subnet(wins_server_subnet); - if((fp = sys_fopen(lock_path(WINS_LIST),"r")) == NULL) + if((fp = x_fopen(lock_path(WINS_LIST),O_RDONLY, 0)) == NULL) { DEBUG(2,("initialise_wins: Can't open wins database file %s. Error was %s\n", WINS_LIST, strerror(errno) )); return True; } - while (!feof(fp)) + while (!x_feof(fp)) { pstring name_str, ip_str, ttl_str, nb_flags_str; unsigned int num_ips; @@ -219,7 +219,7 @@ BOOL initialise_wins(void) version != WINS_VERSION || hash != wins_hash()) { DEBUG(0,("Discarding invalid wins.dat file [%s]\n",line)); - fclose(fp); + x_fclose(fp); return True; } continue; @@ -342,7 +342,7 @@ BOOL initialise_wins(void) free((char *)ip_list); } - fclose(fp); + x_fclose(fp); return True; } -- cgit