Use access() instead of stat() for checking whether scripts exist.
This commit is contained in:
parent
6f1e0ece4e
commit
633c0cf1b0
1 changed files with 1 additions and 2 deletions
|
@ -364,7 +364,6 @@ bool execute_script(const char *name, char **envp)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_SYSTEM
|
#ifdef HAVE_SYSTEM
|
||||||
int status, len;
|
int status, len;
|
||||||
struct stat s;
|
|
||||||
char *scriptname, *p;
|
char *scriptname, *p;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -383,7 +382,7 @@ bool execute_script(const char *name, char **envp)
|
||||||
#ifndef HAVE_TUNEMU
|
#ifndef HAVE_TUNEMU
|
||||||
/* First check if there is a script */
|
/* First check if there is a script */
|
||||||
|
|
||||||
if(stat(scriptname + 1, &s)) {
|
if(access(scriptname + 1, F_OK)) {
|
||||||
free(scriptname);
|
free(scriptname);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue