Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2011-11-05 22:29:51 +0400
committerChristopher Faylor <me@cgf.cx>2011-11-05 22:29:51 +0400
commit481b6ac0c84bbe5639adce0b059c256aa22955ad (patch)
tree6bb60f7b875d6984ffd9f8c2354b5d1110132cab /winsup/cygwin/pinfo.cc
parent26601df44c0d70a74e882f7ca0262220d1e9c382 (diff)
* pinfo.cc (status_exit): Return complete error code. Handle
STATUS_ACCESS_VIOLATION correctly. (pinfo::set_exit_code): Set self->exitcode directly from status_exit.
Diffstat (limited to 'winsup/cygwin/pinfo.cc')
-rw-r--r--winsup/cygwin/pinfo.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc
index 5a77d8f6c..83f231d64 100644
--- a/winsup/cygwin/pinfo.cc
+++ b/winsup/cygwin/pinfo.cc
@@ -130,18 +130,21 @@ status_exit (DWORD x)
mount_table->conv_to_posix_path (pc.get_win32 (), posix_prog, 1);
small_printf ("%s: error while loading shared libraries: %s: cannot open shared object file: No such file or directory\n",
posix_prog, find_first_notloaded_dll (pc));
- x = 127;
+ x = 127 << 8;
}
break;
case STATUS_ILLEGAL_DLL_PSEUDO_RELOCATION: /* custom error value */
/* We've already printed the error message in pseudo-reloc.c */
- x = 127;
+ x = 127 << 8;
+ break;
+ case STATUS_ACCESS_VIOLATION:
+ x = SIGSEGV;
break;
default:
debug_printf ("*** STATUS_%p\n", x);
- x = 127;
+ x = 127 << 8;
}
- return x;
+ return EXITCODE_SET | x;
}
# define self (*this)
@@ -149,8 +152,9 @@ void
pinfo::set_exit_code (DWORD x)
{
if (x >= 0xc0000000UL)
- x = status_exit (x);
- self->exitcode = EXITCODE_SET | (sigExeced ?: (x & 0xff) << 8);
+ self->exitcode = status_exit (x);
+ else
+ self->exitcode = EXITCODE_SET | (sigExeced ?: (x & 0xff) << 8);
}
void