diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index e51752515..6cee815f8 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +2012-08-14 Corinna Vinschen + + * gmon.c (_mcleanup): Fix scope bug when using gmon_out array. + 2012-08-14 Christopher Faylor * errno.cc (errmap): Keep sorted. diff --git a/winsup/cygwin/gmon.c b/winsup/cygwin/gmon.c index 13342eb7d..56f9440dd 100644 --- a/winsup/cygwin/gmon.c +++ b/winsup/cygwin/gmon.c @@ -146,6 +146,9 @@ _mcleanup() struct gmonparam *p = &_gmonparam; struct gmonhdr gmonhdr, *hdr; char *proffile; +#ifndef nope + char gmon_out[] = "gmon.out"; +#endif #ifdef DEBUG int log, len; char dbuf[200]; @@ -203,10 +206,7 @@ _mcleanup() proffile = "gmon.out"; } #else - { - char gmon_out[] = "gmon.out"; - proffile = gmon_out; - } + proffile = gmon_out; #endif fd = open(proffile , O_CREAT|O_TRUNC|O_WRONLY|O_BINARY, 0666);