Finished adding every print to clogs
parent
c286c78c1f
commit
0e431bec54
10
src/rhosts.c
10
src/rhosts.c
|
|
@ -161,7 +161,6 @@ int preserve_static_entries(){
|
||||||
char c = EOF;
|
char c = EOF;
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
|
|
||||||
printf("Static hosts are:\n");
|
|
||||||
do{
|
do{
|
||||||
c = fgetc(hostsf);
|
c = fgetc(hostsf);
|
||||||
strncat(buff, &c, 1);
|
strncat(buff, &c, 1);
|
||||||
|
|
@ -173,7 +172,6 @@ int preserve_static_entries(){
|
||||||
fclose(tmpf);
|
fclose(tmpf);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
printf("%s",buff);
|
|
||||||
buff[0] = '\0';
|
buff[0] = '\0';
|
||||||
}
|
}
|
||||||
}while ( c != EOF);
|
}while ( c != EOF);
|
||||||
|
|
@ -203,7 +201,8 @@ int add_site_entries(struct entry **entries){
|
||||||
|
|
||||||
rc = fputs("# rhosts - static begin\n", tmpf);
|
rc = fputs("# rhosts - static begin\n", tmpf);
|
||||||
if (rc == EOF){
|
if (rc == EOF){
|
||||||
printf("Failed to write to tmp file\n");
|
clogs_print(CLOGS_ERROR,"Failed to write to tmp file %s\n",\
|
||||||
|
TMPLOCATION);
|
||||||
fclose(tmpf);
|
fclose(tmpf);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
@ -218,7 +217,8 @@ int add_site_entries(struct entry **entries){
|
||||||
}
|
}
|
||||||
rc = fputs("# rhosts - static end\n# rhosts end\n", tmpf);
|
rc = fputs("# rhosts - static end\n# rhosts end\n", tmpf);
|
||||||
if (rc == EOF){
|
if (rc == EOF){
|
||||||
printf("Failed to write to tmp file\n");
|
clogs_print(CLOGS_ERROR,"Failed to write to tmp file %s\n", \
|
||||||
|
TMPLOCATION);
|
||||||
fclose(tmpf);
|
fclose(tmpf);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
@ -235,7 +235,7 @@ int copy_tmp_to_hosts(){
|
||||||
FILE *hostsf;
|
FILE *hostsf;
|
||||||
hostsf = fopen(HOSTSLOCATION, "w");
|
hostsf = fopen(HOSTSLOCATION, "w");
|
||||||
if (hostsf == NULL){
|
if (hostsf == NULL){
|
||||||
printf("Failed to open %s\n",HOSTSLOCATION);
|
clogs_print(CLOGS_ERROR,"Failed to open %s\n",HOSTSLOCATION);
|
||||||
fclose(tmpf);
|
fclose(tmpf);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue