* gmon.c (_mcleanup): Fix scope bug when using gmon_out array.

This commit is contained in:
Corinna Vinschen 2012-08-14 19:38:43 +00:00
parent 0587c5ef4f
commit 25a520c260
2 changed files with 8 additions and 4 deletions

View File

@ -1,3 +1,7 @@
2012-08-14 Corinna Vinschen <corinna@vinschen.de>
* gmon.c (_mcleanup): Fix scope bug when using gmon_out array.
2012-08-14 Christopher Faylor <me.cygwin2012@cgf.cx> 2012-08-14 Christopher Faylor <me.cygwin2012@cgf.cx>
* errno.cc (errmap): Keep sorted. * errno.cc (errmap): Keep sorted.

View File

@ -146,6 +146,9 @@ _mcleanup()
struct gmonparam *p = &_gmonparam; struct gmonparam *p = &_gmonparam;
struct gmonhdr gmonhdr, *hdr; struct gmonhdr gmonhdr, *hdr;
char *proffile; char *proffile;
#ifndef nope
char gmon_out[] = "gmon.out";
#endif
#ifdef DEBUG #ifdef DEBUG
int log, len; int log, len;
char dbuf[200]; char dbuf[200];
@ -203,10 +206,7 @@ _mcleanup()
proffile = "gmon.out"; proffile = "gmon.out";
} }
#else #else
{ proffile = gmon_out;
char gmon_out[] = "gmon.out";
proffile = gmon_out;
}
#endif #endif
fd = open(proffile , O_CREAT|O_TRUNC|O_WRONLY|O_BINARY, 0666); fd = open(proffile , O_CREAT|O_TRUNC|O_WRONLY|O_BINARY, 0666);