diff options
author | Christopher Faylor <me@cgf.cx> | 2000-10-12 22:15:47 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2000-10-12 22:15:47 +0000 |
commit | 1ec4f618feb517c020ff25784bedc66dd4f6f0e2 (patch) | |
tree | d146a1dab1ba5d6fcd6411bc85c783becac7f54a /winsup/cygwin/strace.cc | |
parent | 5e0d760fb82d2d04c34306803253777aa5040fce (diff) | |
download | newlib-1ec4f618feb517c020ff25784bedc66dd4f6f0e2.zip newlib-1ec4f618feb517c020ff25784bedc66dd4f6f0e2.tar.gz newlib-1ec4f618feb517c020ff25784bedc66dd4f6f0e2.tar.bz2 |
* child_info: Bump child_info "version".
(child_info): Move some fields from child_info_spawn to here.
* cygheap.cc: Make cygheap pointers NOCOPY.
* dcrt0.cc (dll_crt0_1): Copy cygwin heap here regardless of whether we've been
forked or execed.
* dtable.cc (dtable::fixup_after_fork): Just release close-on-exec fds.
* exceptions.cc (stackdump): Respond to C warning.
* fork.cc: Reorganize to minimize stack copying.
(fork_child): New function.
(fork_parent): Ditto.
(sync_with_child): Don't suspend the forkee.
(sync_with_parent): Ditto. Make into a function.
* heap.cc (heap_init): Add some debugging output.
* path.cc (path_conv::check): Add an assertion.
(has_suffix): Ditto.
* security.cc (get_pw_sid): Defend against NULL.
* sigproc.cc (proc_subproc): Fix debugging output.
(wait_sig): Ditto.
* strace.cc: Make statics NO_COPY throughout.
(strace::vsprntf): Defend against NULL.
Diffstat (limited to 'winsup/cygwin/strace.cc')
-rw-r--r-- | winsup/cygwin/strace.cc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/winsup/cygwin/strace.cc b/winsup/cygwin/strace.cc index 92494a4..badf000 100644 --- a/winsup/cygwin/strace.cc +++ b/winsup/cygwin/strace.cc @@ -21,7 +21,7 @@ details. */ #define PROTECT(x) x[sizeof(x)-1] = 0 #define CHECK(x) if (x[sizeof(x)-1] != 0) { small_printf("array bound exceeded %d\n", __LINE__); ExitProcess(1); } -class strace NO_COPY strace; +class NO_COPY strace strace; /* 'twould be nice to declare this in winsup.h but winsup.h doesn't require stdarg.h, so we declare it here instead. */ @@ -31,9 +31,9 @@ class strace NO_COPY strace; int strace::microseconds() { - static int first_microsec = 0; - static long long hires_frequency = 0; - static int hires_initted = 0; + static NO_COPY int first_microsec = 0; + static NO_COPY long long hires_frequency = 0; + static NO_COPY int hires_initted = 0; int microsec; @@ -104,7 +104,7 @@ strace::vsprntf (char *buf, const char *func, const char *infmt, va_list ap) { int count; char fmt[80]; - static int nonewline = FALSE; + static NO_COPY int nonewline = FALSE; DWORD err = GetLastError (); const char *tn = threadname (0); char *pn = __progname ?: myself->progname; @@ -121,7 +121,9 @@ strace::vsprntf (char *buf, const char *func, const char *infmt, va_list ap) else { char *p, progname[MAX_PATH + 1]; - if ((p = strrchr (pn, '\\')) != NULL) + if (!pn) + p = (char *) "*** unknown ***"; + else if ((p = strrchr (pn, '\\')) != NULL) p++; else if ((p = strrchr (pn, '/')) != NULL) p++; @@ -206,7 +208,7 @@ strace::prntf (unsigned category, const char *func, const char *fmt, ...) SetLastError (err); } -static const struct tab +static NO_COPY const struct tab { int v; const char *n; |