* pinfo.cc (status_exit): Return complete error code. Handle

STATUS_ACCESS_VIOLATION correctly.
(pinfo::set_exit_code): Set self->exitcode directly from status_exit.
This commit is contained in:
Christopher Faylor 2011-11-05 18:29:51 +00:00
parent 26601df44c
commit 481b6ac0c8
2 changed files with 16 additions and 6 deletions

View File

@ -1,3 +1,9 @@
2011-11-05 Christopher Faylor <me.cygwin2011@cgf.cx>
* pinfo.cc (status_exit): Return complete error code. Handle
STATUS_ACCESS_VIOLATION correctly.
(pinfo::set_exit_code): Set self->exitcode directly from status_exit.
2011-11-04 Christopher Faylor <me.cygwin2011@cgf.cx> 2011-11-04 Christopher Faylor <me.cygwin2011@cgf.cx>
* pinfo.h (pinfo::reattach): Only set destroy to false when * pinfo.h (pinfo::reattach): Only set destroy to false when

View File

@ -130,18 +130,21 @@ status_exit (DWORD x)
mount_table->conv_to_posix_path (pc.get_win32 (), posix_prog, 1); 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", 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)); posix_prog, find_first_notloaded_dll (pc));
x = 127; x = 127 << 8;
} }
break; break;
case STATUS_ILLEGAL_DLL_PSEUDO_RELOCATION: /* custom error value */ case STATUS_ILLEGAL_DLL_PSEUDO_RELOCATION: /* custom error value */
/* We've already printed the error message in pseudo-reloc.c */ /* We've already printed the error message in pseudo-reloc.c */
x = 127; x = 127 << 8;
break;
case STATUS_ACCESS_VIOLATION:
x = SIGSEGV;
break; break;
default: default:
debug_printf ("*** STATUS_%p\n", x); debug_printf ("*** STATUS_%p\n", x);
x = 127; x = 127 << 8;
} }
return x; return EXITCODE_SET | x;
} }
# define self (*this) # define self (*this)
@ -149,8 +152,9 @@ void
pinfo::set_exit_code (DWORD x) pinfo::set_exit_code (DWORD x)
{ {
if (x >= 0xc0000000UL) if (x >= 0xc0000000UL)
x = status_exit (x); self->exitcode = status_exit (x);
self->exitcode = EXITCODE_SET | (sigExeced ?: (x & 0xff) << 8); else
self->exitcode = EXITCODE_SET | (sigExeced ?: (x & 0xff) << 8);
} }
void void