diff options
author | Christopher Faylor <me@cgf.cx> | 2005-05-09 01:21:43 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2005-05-09 01:21:43 +0000 |
commit | 26c07f704b8f95681afe552fe21cd186574b4044 (patch) | |
tree | 2bb5397f44ee038312679ec05abca6774637aa5f | |
parent | 1cd8ccec870628c8767a71bc034fc660e37b4399 (diff) | |
download | cygnal-26c07f704b8f95681afe552fe21cd186574b4044.tar.gz cygnal-26c07f704b8f95681afe552fe21cd186574b4044.tar.bz2 cygnal-26c07f704b8f95681afe552fe21cd186574b4044.zip |
* strace.cc (attach_process): Don't call load_cygwin(). Assume that it's
already happened.
(dotoggle): Ditto.
(main): Set argv from cygwin environment, if it exists.
-rw-r--r-- | winsup/utils/ChangeLog | 7 | ||||
-rw-r--r-- | winsup/utils/strace.cc | 12 |
2 files changed, 16 insertions, 3 deletions
diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog index ccf93d03e..9438a5586 100644 --- a/winsup/utils/ChangeLog +++ b/winsup/utils/ChangeLog @@ -1,3 +1,10 @@ +2005-05-08 Christopher Faylor <cgf@timesys.com> + + * strace.cc (attach_process): Don't call load_cygwin(). Assume that + it's already happened. + (dotoggle): Ditto. + (main): Set argv from cygwin environment, if it exists. + 2005-05-01 Christopher Faylor <cgf@timesys.com> * mount.cc (usage): Clarify action of -m option. diff --git a/winsup/utils/strace.cc b/winsup/utils/strace.cc index ab0dc62e2..6ed267a54 100644 --- a/winsup/utils/strace.cc +++ b/winsup/utils/strace.cc @@ -1,6 +1,6 @@ /* strace.cc - Copyright 2000, 2001, 2002, 2003, 2004 Red Hat Inc. + Copyright 2000, 2001, 2002, 2003, 2004, 2005 Red Hat Inc. Written by Chris Faylor <cgf@redhat.com> @@ -279,7 +279,6 @@ load_cygwin () static void attach_process (pid_t pid) { - load_cygwin (); child_pid = (DWORD) cygwin_internal (CW_CYGWIN_PID_TO_WINPID, pid); if (!child_pid) { @@ -652,7 +651,6 @@ proc_child (unsigned mask, FILE *ofile, pid_t pid) static void dotoggle (pid_t pid) { - load_cygwin (); child_pid = (DWORD) cygwin_internal (CW_CYGWIN_PID_TO_WINPID, pid); if (!child_pid) { @@ -906,6 +904,14 @@ main (int argc, char **argv) int opt; int toggle = 0; + if (load_cygwin ()) + { + char **av = (char **) cygwin_internal (CW_ARGV); + if (av) + for (argc = 0, argv = av; *av; av++) + argc++; + } + if (!(pgm = strrchr (*argv, '\\')) && !(pgm = strrchr (*argv, '/'))) pgm = *argv; else |