Issue 15896 - sal/osl/unx/signal.c and C++...
Summary: sal/osl/unx/signal.c and C++...
Status: CLOSED FIXED
Alias: None
Product: porting
Classification: Code
Component: code (show other issues)
Version: OOo 1.1 Beta2
Hardware: All All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: Martin Hollmichel
QA Contact: issues@porting
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-06-21 14:58 UTC by pavel
Modified: 2003-06-21 17:13 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
New signal.c diff (1.01 KB, patch)
2003-06-21 16:40 UTC, pavel
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
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
-