summaryrefslogtreecommitdiff
path: root/sal/osl/unx
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2005-05-06 08:19:26 +0000
committerOliver Bolte <obo@openoffice.org>2005-05-06 08:19:26 +0000
commit85f020db4081c39f7ba9f718214c4d03000d055d (patch)
tree6bdf1572805e4c20ae9198f9023f9d0de4cd6089 /sal/osl/unx
parent49656c8e025624cabac4b4a483917ecdb2097968 (diff)
INTEGRATION: CWS crashrep8 (1.24.50); FILE MERGED
2005/05/04 10:22:00 hro 1.24.50.1: #121982# Resolve softlinks in paths sent by crash reporting mechanism
Diffstat (limited to 'sal/osl/unx')
-rw-r--r--sal/osl/unx/signal.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/sal/osl/unx/signal.c b/sal/osl/unx/signal.c
index 5354093ccb53..81094f0ef372 100644
--- a/sal/osl/unx/signal.c
+++ b/sal/osl/unx/signal.c
@@ -2,9 +2,9 @@
*
* $RCSfile: signal.c,v $
*
- * $Revision: 1.24 $
+ * $Revision: 1.25 $
*
- * last change: $Author: rt $ $Date: 2004-11-26 14:41:23 $
+ * last change: $Author: obo $ $Date: 2005-05-06 09:19:26 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -526,9 +526,6 @@ static int ReportCrash( int Signal )
{
Dl_info dl_info;
- /* Don't want to use malloc here */
- char buffer[MAX_PATH_LEN];
-
fprintf( stackout, "0x%x:",
(unsigned int)stackframes[iFrame] );
@@ -544,18 +541,27 @@ static int ReportCrash( int Signal )
{
const char *dli_fname = NULL;
const char *dli_fdir = NULL;
+ const char *dli_fpath = NULL;
+ char szCanonicPath[PATH_MAX];
+ char szDirectory[PATH_MAX];
/* Don't expect that dladdr filled all members of dl_info */
- dli_fname = dl_info.dli_fname ? strrchr( dl_info.dli_fname, '/' ) : NULL;
+
+ if ( dl_info.dli_fname && realpath( dl_info.dli_fname, szCanonicPath ) )
+ dli_fpath = szCanonicPath;
+ else
+ dli_fpath = dl_info.dli_fname;
+
+ dli_fname = dli_fpath ? strrchr( dli_fpath, '/' ) : NULL;
if ( dli_fname )
{
++dli_fname;
- memcpy( buffer, dl_info.dli_fname, dli_fname - dl_info.dli_fname );
- buffer[dli_fname - dl_info.dli_fname] = 0;
- dli_fdir = buffer;
+ memcpy( szDirectory, dli_fpath, dli_fname - dli_fpath );
+ szDirectory[dli_fname - dli_fpath] = 0;
+ dli_fdir = szDirectory;
}
else
- dli_fname = dl_info.dli_fname;
+ dli_fname = dli_fpath;
/* create checksum of library on stack */
if ( dli_fname )