Remove unnecessary negation
This commit is contained in:
parent
661f84912e
commit
896b4400da
@ -71,13 +71,7 @@ int main(int argc, char *argv[]){
|
|||||||
if(fork() == 0){
|
if(fork() == 0){
|
||||||
|
|
||||||
// Check if program is even executable
|
// Check if program is even executable
|
||||||
if(!(!access(PROGRAM, F_OK) && !access(PROGRAM, R_OK) && !access(PROGRAM, X_OK))){
|
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{
|
|
||||||
|
|
||||||
// Exec program silently by default
|
// Exec program silently by default
|
||||||
if(!verbose){
|
if(!verbose){
|
||||||
@ -91,6 +85,14 @@ int main(int argc, char *argv[]){
|
|||||||
else
|
else
|
||||||
execlp(PROGRAM, PROGRAM, NULL);
|
execlp(PROGRAM, PROGRAM, NULL);
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
|
||||||
|
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 {
|
else {
|
||||||
|
Loading…
Reference in New Issue
Block a user