* pinfo.h (pinfo::status_exit): Rename from former static function in pinfo.cc.

(pinfo::operator == (char *)): Remove unused operator.
* pinfo.cc (pinfo::status_exit): Move this function info pinfo class.  Use
progname from the pinfo rather than myself.  Be defensive when inspecting
procinfo.
This commit is contained in:
Christopher Faylor 2013-03-29 16:19:11 +00:00
parent 6fcb223858
commit bb93b7ab95
4 changed files with 25 additions and 6 deletions

View File

@ -1,3 +1,12 @@
2013-03-29 Christopher Faylor <me.cygwin2013@cgf.cx>
* pinfo.h (pinfo::status_exit): Rename from former static function in
pinfo.cc.
(pinfo::operator == (char *)): Remove unused operator.
* pinfo.cc (pinfo::status_exit): Move this function info pinfo class.
Use progname from the pinfo rather than myself. Be defensive when
inspecting procinfo.
2013-03-29 Christopher Faylor <me.cygwin2013@cgf.cx> 2013-03-29 Christopher Faylor <me.cygwin2013@cgf.cx>
* sigproc.cc (wait_sig): Avoid uninitialized use of nb when retrying. * sigproc.cc (wait_sig): Avoid uninitialized use of nb when retrying.

View File

@ -110,17 +110,23 @@ pinfo_init (char **envp, int envc)
debug_printf ("pid %d, pgid %d", myself->pid, myself->pgid); debug_printf ("pid %d, pgid %d", myself->pid, myself->pgid);
} }
static DWORD DWORD
status_exit (DWORD x) pinfo::status_exit (DWORD x)
{ {
switch (x) switch (x)
{ {
case STATUS_DLL_NOT_FOUND: case STATUS_DLL_NOT_FOUND:
{ {
char posix_prog[NT_MAX_PATH]; char posix_prog[NT_MAX_PATH];
UNICODE_STRING uc; path_conv pc;
RtlInitUnicodeString(&uc, myself->progname); if (!procinfo)
path_conv pc (&uc, PC_NOWARN); pc.check ("/dev/null");
else
{
UNICODE_STRING uc;
RtlInitUnicodeString(&uc, procinfo->progname);
pc.check (&uc, PC_NOWARN);
}
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));

View File

@ -179,7 +179,6 @@ public:
int operator == (_pinfo *x) const {return x == procinfo;} int operator == (_pinfo *x) const {return x == procinfo;}
int operator == (void *x) const {return procinfo == x;} int operator == (void *x) const {return procinfo == x;}
int operator == (int x) const {return (int) procinfo == (int) x;} int operator == (int x) const {return (int) procinfo == (int) x;}
int operator == (char *x) const {return (char *) procinfo == x;}
_pinfo *operator * () const {return procinfo;} _pinfo *operator * () const {return procinfo;}
operator _pinfo * () const {return procinfo;} operator _pinfo * () const {return procinfo;}
void preserve () { destroy = false; } void preserve () { destroy = false; }
@ -206,6 +205,8 @@ public:
void set_acl (); void set_acl ();
friend class _pinfo; friend class _pinfo;
friend class winpids; friend class winpids;
private:
DWORD status_exit (DWORD);
}; };
#define ISSTATE(p, f) (!!((p)->process_state & f)) #define ISSTATE(p, f) (!!((p)->process_state & f))

View File

@ -60,3 +60,6 @@ Bug fixes:
- Fix some bugs in CTRL-S/CTRL-Q handling in ptys. - Fix some bugs in CTRL-S/CTRL-Q handling in ptys.
See: http://cygwin.com/ml/cygwin/2012-10/msg00089.html See: http://cygwin.com/ml/cygwin/2012-10/msg00089.html
- Fix "error while loading shared libraries:" message to properly
display the shared library name in more cases.