Issue 15896

Summary: sal/osl/unx/signal.c and C++...
Product: porting Reporter: pavel
Component: codeAssignee: Martin Hollmichel <nesshof>
Status: CLOSED FIXED QA Contact: issues@porting <issues>
Severity: Trivial    
Priority: P3 CC: issues
Version: OOo 1.1 Beta2   
Target Milestone: ---   
Hardware: All   
OS: All   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
New signal.c diff none

Description pavel 2003-06-21 14:58:51 UTC
Hi,

the author of this code probably really likes C++, but this code is
compiled with C compiler.

--- signal.c.~1.13.~	2003-06-18 23:50:15.000000000 +0200
+++ signal.c	2003-06-21 15:46:35.000000000 +0200
@@ -327,13 +327,12 @@
 				void *stackframes[1024];
 				int  iFrame;
 				int  nFrames = backtrace( stackframes,
sizeof(stackframes)/sizeof(stackframes[0]));
+				FILE *xmlout = fopen( pXMLTempName, "w" );
+				FILE *stackout = fopen( pStackTempName, "w" );
 			
 				pXMLTempName = tmpnam( szXMLTempNameBuffer );
 				pStackTempName = tmpnam( szStackTempNameBuffer );
 
-				FILE *xmlout = fopen( pXMLTempName, "w" );
-				FILE *stackout = fopen( pStackTempName, "w" );
-
 				fprintf( xmlout, "<errormail:Stack type=\"%s\">\n", STACKTYPE );
 
 				for ( iFrame = 0; iFrame < nFrames; iFrame++ )
@@ -447,11 +446,10 @@
 static void PrintStack( int sig )
 {
 	void *buffer[MAX_FRAME_COUNT];
+	int size = backtrace( buffer, sizeof(buffer) / sizeof(buffer[0]) );
 
 	fprintf( stderr, "\n\nFatal exception: Signal %d\n", sig );
 
-	int size = backtrace( buffer, sizeof(buffer) / sizeof(buffer[0]) );
-
 	if ( size > 0 )
 	{
 		fputs( "Stack:\n", stderr );
Comment 1 pavel 2003-06-21 16:37:30 UTC
As Kevin pointed out, this patch in not correct. Attached is new
version signal.diff.
Comment 2 pavel 2003-06-21 16:40:49 UTC
Created attachment 7033 [details]
New signal.c diff
Comment 3 pavel 2003-06-21 17:11:46 UTC
Kevin approved new patch in dev@porting, so I commited it.

Comment 4 pavel 2003-06-21 17:13:38 UTC
-