Use PATHEXT when checking for the presence of scripts on Windows.

It seems like a lot of overhead to call access() for every possible extension
defined in PATHEXT, but apparently this is what Windows does itself too. At
least this avoids calling system() when the script one is looking for does not
exist at all.

Since the tinc utility also needs to call scripts, execute_script() is now
split off into its own source file.
This commit is contained in:
Guus Sliepen 2013-08-23 19:24:36 +02:00
parent 21184674b3
commit 57991e2642
13 changed files with 171 additions and 86 deletions

View file

@ -38,9 +38,9 @@
#include "netutl.h"
#include "node.h"
#include "prf.h"
#include "process.h"
#include "protocol.h"
#include "rsa.h"
#include "script.h"
#include "sptps.h"
#include "utils.h"
#include "xalloc.h"