Whoops~
This commit is contained in:
parent
c856c49a92
commit
a79509c974
@ -70,14 +70,12 @@ int main(int argc, char *argv[]){
|
||||
|
||||
if(fork() == 0){
|
||||
|
||||
|
||||
// Check if program is even executable
|
||||
if(!(!access(PROGRAM, F_OK) && !access(PROGRAM, R_OK) && !access(PROGRAM, X_OK))){
|
||||
fprintf(stderr, "ERROR: It is not possible to execute %s: ", PROGRAM);
|
||||
if(access(PROGRAM, F_OK)) fprintf(stderr, "It does not exist.\n");
|
||||
else fprintf(stderr, "Access denied. (Are you root?)\n");
|
||||
return 1;
|
||||
|
||||
}
|
||||
else{
|
||||
|
||||
@ -92,11 +90,9 @@ int main(int argc, char *argv[]){
|
||||
}
|
||||
else
|
||||
execlp(PROGRAM, PROGRAM, NULL);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
if(verbose)
|
||||
@ -108,11 +104,11 @@ int main(int argc, char *argv[]){
|
||||
printf("Exit: %d\n", statval);
|
||||
|
||||
if(statval == STATUS_OK){
|
||||
// If exit 0, write file with nothing in it
|
||||
// If exit is STATUS_OK, write file with nothing in it
|
||||
FILE *f = fopen(VRFFILE, "w");
|
||||
if(f == NULL){
|
||||
printf("ERROR opening file");
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
fclose(f);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user