more fprints
This commit is contained in:
parent
a6c531e78a
commit
3b55f715ed
@ -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);
|
||||||
@ -116,14 +116,10 @@ int main(int argc, char *argv[]){
|
|||||||
else
|
else
|
||||||
// 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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user