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/libsmb/namequery.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'source3/libsmb') diff --git a/source3/libsmb/namequery.c b/source3/libsmb/namequery.c index 39159be41b..9dea4b7694 100644 --- a/source3/libsmb/namequery.c +++ b/source3/libsmb/namequery.c @@ -449,26 +449,26 @@ struct in_addr *name_query(int fd,const char *name,int name_type, Start parsing the lmhosts file. *********************************************************/ -FILE *startlmhosts(char *fname) +XFILE *startlmhosts(char *fname) { - FILE *fp = sys_fopen(fname,"r"); - if (!fp) { - DEBUG(4,("startlmhosts: Can't open lmhosts file %s. Error was %s\n", - fname, strerror(errno))); - return NULL; - } - return fp; + XFILE *fp = x_fopen(fname,O_RDONLY, 0); + if (!fp) { + DEBUG(4,("startlmhosts: Can't open lmhosts file %s. Error was %s\n", + fname, strerror(errno))); + return NULL; + } + return fp; } /******************************************************** Parse the next line in the lmhosts file. *********************************************************/ -BOOL getlmhostsent( FILE *fp, pstring name, int *name_type, struct in_addr *ipaddr) +BOOL getlmhostsent( XFILE *fp, pstring name, int *name_type, struct in_addr *ipaddr) { pstring line; - while(!feof(fp) && !ferror(fp)) { + while(!x_feof(fp) && !x_ferror(fp)) { pstring ip,flags,extra; char *ptr; int count = 0; @@ -549,9 +549,9 @@ BOOL getlmhostsent( FILE *fp, pstring name, int *name_type, struct in_addr *ipad Finish parsing the lmhosts file. *********************************************************/ -void endlmhosts(FILE *fp) +void endlmhosts(XFILE *fp) { - fclose(fp); + x_fclose(fp); } BOOL name_register_wins(const char *name, int name_type) @@ -741,7 +741,7 @@ static BOOL resolve_lmhosts(const char *name, int name_type, * "lmhosts" means parse the local lmhosts file. */ - FILE *fp; + XFILE *fp; pstring lmhost_name; int name_type2; struct in_addr return_ip; -- cgit