summaryrefslogtreecommitdiffstats
path: root/source3/nmbd/nmbd_namelistdb.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-09-10 13:09:54 +0000
committerAndrew Tridgell <tridge@samba.org>2001-09-10 13:09:54 +0000
commit4d65bc094941f1214efdf03c9d363715aa35a656 (patch)
tree9c418080528516dc54d4402c3b21bef44777bc61 /source3/nmbd/nmbd_namelistdb.c
parent79139fe8d882c39620b0d52ef081f639d1294917 (diff)
downloadsamba-4d65bc094941f1214efdf03c9d363715aa35a656.tar.gz
samba-4d65bc094941f1214efdf03c9d363715aa35a656.tar.xz
samba-4d65bc094941f1214efdf03c9d363715aa35a656.zip
convert more code to use XFILE
(This used to be commit fd24265c06f6d2b636c1863941a33029dd9f3828)
Diffstat (limited to 'source3/nmbd/nmbd_namelistdb.c')
-rw-r--r--source3/nmbd/nmbd_namelistdb.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/source3/nmbd/nmbd_namelistdb.c b/source3/nmbd/nmbd_namelistdb.c
index efac14c8c6a..281197df65b 100644
--- a/source3/nmbd/nmbd_namelistdb.c
+++ b/source3/nmbd/nmbd_namelistdb.c
@@ -528,19 +528,19 @@ void add_samba_names_to_subnet( struct subnet_record *subrec )
into a file. Initiated by SIGHUP - used to debug the state of the namelists.
**************************************************************************/
-static void dump_subnet_namelist( struct subnet_record *subrec, FILE *fp)
+static void dump_subnet_namelist( struct subnet_record *subrec, XFILE *fp)
{
struct name_record *namerec;
char *src_type;
struct tm *tm;
int i;
- fprintf(fp, "Subnet %s\n----------------------\n", subrec->subnet_name);
+ x_fprintf(fp, "Subnet %s\n----------------------\n", subrec->subnet_name);
for( namerec = (struct name_record *)ubi_trFirst( subrec->namelist );
namerec;
namerec = (struct name_record *)ubi_trNext( namerec ) )
{
- fprintf(fp,"\tName = %s\t", nmb_namestr(&namerec->name));
+ x_fprintf(fp,"\tName = %s\t", nmb_namestr(&namerec->name));
switch(namerec->data.source)
{
case LMHOSTS_NAME:
@@ -568,29 +568,29 @@ static void dump_subnet_namelist( struct subnet_record *subrec, FILE *fp)
src_type = "unknown!";
break;
}
- fprintf(fp,"Source = %s\nb_flags = %x\t", src_type, namerec->data.nb_flags);
+ x_fprintf(fp,"Source = %s\nb_flags = %x\t", src_type, namerec->data.nb_flags);
if(namerec->data.death_time != PERMANENT_TTL)
{
tm = LocalTime(&namerec->data.death_time);
- fprintf(fp, "death_time = %s\t", asctime(tm));
+ x_fprintf(fp, "death_time = %s\t", asctime(tm));
}
else
- fprintf(fp, "death_time = PERMANENT\t");
+ x_fprintf(fp, "death_time = PERMANENT\t");
if(namerec->data.refresh_time != PERMANENT_TTL)
{
tm = LocalTime(&namerec->data.refresh_time);
- fprintf(fp, "refresh_time = %s\n", asctime(tm));
+ x_fprintf(fp, "refresh_time = %s\n", asctime(tm));
}
else
- fprintf(fp, "refresh_time = PERMANENT\n");
+ x_fprintf(fp, "refresh_time = PERMANENT\n");
- fprintf(fp, "\t\tnumber of IPS = %d", namerec->data.num_ips);
+ x_fprintf(fp, "\t\tnumber of IPS = %d", namerec->data.num_ips);
for(i = 0; i < namerec->data.num_ips; i++)
- fprintf(fp, "\t%s", inet_ntoa(namerec->data.ip[i]));
+ x_fprintf(fp, "\t%s", inet_ntoa(namerec->data.ip[i]));
- fprintf(fp, "\n\n");
+ x_fprintf(fp, "\n\n");
}
}
@@ -601,10 +601,10 @@ static void dump_subnet_namelist( struct subnet_record *subrec, FILE *fp)
void dump_all_namelists(void)
{
- FILE *fp;
+ XFILE *fp;
struct subnet_record *subrec;
- fp = sys_fopen(lock_path("namelist.debug"),"w");
+ fp = x_fopen(lock_path("namelist.debug"),O_WRONLY|O_CREAT|O_TRUNC, 0644);
if (!fp)
{
@@ -626,5 +626,5 @@ void dump_all_namelists(void)
if( wins_server_subnet != NULL )
dump_subnet_namelist( wins_server_subnet, fp );
- fclose( fp );
+ x_fclose( fp );
}