]> git.meshlink.io Git - meshlink/commitdiff
Use access() instead of stat() for checking whether scripts exist.
authorGuus Sliepen <guus@tinc-vpn.org>
Mon, 14 Sep 2009 22:36:07 +0000 (00:36 +0200)
committerGuus Sliepen <guus@tinc-vpn.org>
Mon, 14 Sep 2009 22:36:07 +0000 (00:36 +0200)
src/process.c

index f03f12a43f08865daa54a3a145f111aa51b5d339..544c2242fcce5bec1c845b520ba0bbf889ea809b 100644 (file)
@@ -364,7 +364,6 @@ bool execute_script(const char *name, char **envp)
 {
 #ifdef HAVE_SYSTEM
        int status, len;
-       struct stat s;
        char *scriptname, *p;
        int i;
 
@@ -383,7 +382,7 @@ bool execute_script(const char *name, char **envp)
 #ifndef HAVE_TUNEMU
        /* First check if there is a script */
 
-       if(stat(scriptname + 1, &s)) {
+       if(access(scriptname + 1, F_OK)) {
                free(scriptname);
                return true;
        }