From 9b53b52a80f79a7746f51e2092b23dfab3d50c6f Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Tue, 27 Apr 2010 23:06:48 +0000 Subject: [PATCH] * spawn.cc (find_exec): Use the first detected errno when lookup fails. --- winsup/cygwin/ChangeLog | 4 ++++ winsup/cygwin/spawn.cc | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 20ea015dd..7024ed233 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +2010-04-27 Christopher Faylor + + * spawn.cc (find_exec): Use the first detected errno when lookup fails. + 2010-04-27 Corinna Vinschen * include/regex.h: Include _ansi.h to avoid missing out on preprocessor diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc index c8b2fcf5a..e583f8fea 100644 --- a/winsup/cygwin/spawn.cc +++ b/winsup/cygwin/spawn.cc @@ -173,7 +173,9 @@ find_exec (const char *name, path_conv& buf, const char *mywinenv, debug_printf ("trying %s", tmp); - if ((suffix = perhaps_suffix (tmp, buf, err, opt)) != NULL) + int err1; + + if ((suffix = perhaps_suffix (tmp, buf, err1, opt)) != NULL) { if (buf.has_acls () && check_file_access (buf, X_OK, true)) continue;