From: Guus Sliepen Date: Mon, 14 Sep 2009 22:36:07 +0000 (+0200) Subject: Use access() instead of stat() for checking whether scripts exist. X-Git-Tag: release-1.0.10~27 X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=commitdiff_plain;h=633c0cf1b067d118d5453bc8522fab65ffc82d2c Use access() instead of stat() for checking whether scripts exist. --- diff --git a/src/process.c b/src/process.c index f03f12a4..544c2242 100644 --- a/src/process.c +++ b/src/process.c @@ -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; }