mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-09 04:21:49 +08:00
Use errno value of first openp failure
Fixes this testsuite fail on Windows: FAIL: gdb.base/bad-file.exp: directory If both tries to open the file fail (without and with ".exe"), use the errno value of the first try. gdb/ChangeLog: 2020-05-27 Hannes Domani <ssbssa@yahoo.de> * exec.c (exec_file_attach): Use errno value of first openp failure.
This commit is contained in:
parent
6479bf854a
commit
96445f0b66
@ -1,3 +1,7 @@
|
||||
2020-05-27 Hannes Domani <ssbssa@yahoo.de>
|
||||
|
||||
* exec.c (exec_file_attach): Use errno value of first openp failure.
|
||||
|
||||
2020-05-27 Hannes Domani <ssbssa@yahoo.de>
|
||||
|
||||
* nat/windows-nat.c (windows_thread_info::~windows_thread_info):
|
||||
|
@ -435,6 +435,7 @@ exec_file_attach (const char *filename, int from_tty)
|
||||
#if defined(__GO32__) || defined(_WIN32) || defined(__CYGWIN__)
|
||||
if (scratch_chan < 0)
|
||||
{
|
||||
int first_errno = errno;
|
||||
char *exename = (char *) alloca (strlen (filename) + 5);
|
||||
|
||||
strcat (strcpy (exename, filename), ".exe");
|
||||
@ -443,6 +444,8 @@ exec_file_attach (const char *filename, int from_tty)
|
||||
O_RDWR | O_BINARY
|
||||
: O_RDONLY | O_BINARY,
|
||||
&scratch_storage);
|
||||
if (scratch_chan < 0)
|
||||
errno = first_errno;
|
||||
}
|
||||
#endif
|
||||
if (scratch_chan < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user