more fprints

This commit is contained in:
Bandie 2018-03-21 22:52:27 +01:00
parent a6c531e78a
commit 3b55f715ed
Signed by: Bandie
GPG Key ID: C1E133BC65A822DD

View File

@ -71,7 +71,7 @@ int main(int argc, char *argv[]){
// Signal handling // Signal handling
if(signal(SIGTERM, sig_handler) == SIG_ERR || signal(SIGINT, sig_handler) == SIG_ERR) if(signal(SIGTERM, sig_handler) == SIG_ERR || signal(SIGINT, sig_handler) == SIG_ERR)
printf("ERROR: Can't catch signal!"); fprintf(stderr, "ERROR: Can't catch signal!\n");
while(1){ while(1){
@ -107,7 +107,7 @@ int main(int argc, char *argv[]){
if(access(VRFFILE, F_OK) == -1){ if(access(VRFFILE, F_OK) == -1){
FILE *f = fopen(VRFFILE, "w"); FILE *f = fopen(VRFFILE, "w");
if(f == NULL){ if(f == NULL){
printf("ERROR opening file"); fprintf(stderr, "ERROR opening file\n");
return 1; return 1;
} }
fclose(f); fclose(f);
@ -117,13 +117,9 @@ int main(int argc, char *argv[]){
// If exit != 0 // If exit != 0
if(access(VRFFILE, F_OK) != -1) //File exists? if(access(VRFFILE, F_OK) != -1) //File exists?
unlink(VRFFILE); unlink(VRFFILE);
} }
sleep(SLEEP); sleep(SLEEP);
} }
sig_handler(SIGTERM); sig_handler(SIGTERM);
return 0; return 0;
} }