[Libreoffice-commits] .: 4 commits - cppuhelper/source desktop/inc desktop/source desktop/unx sal/osl solenv/bin

Stephan Bergmann sbergmann at kemper.freedesktop.org
Wed Sep 21 14:37:03 PDT 2011


 cppuhelper/source/shlib.cxx    |    2 +-
 desktop/inc/app.hxx            |    1 +
 desktop/source/app/app.cxx     |   20 +++++++++++++-------
 desktop/source/app/appinit.cxx |   15 +++------------
 desktop/unx/source/start.c     |    6 ++++--
 sal/osl/unx/process.c          |    2 ++
 solenv/bin/ooinstall           |    3 ++-
 7 files changed, 26 insertions(+), 23 deletions(-)

New commits:
commit aa7541be959fe5406bed867c65381d17a48deda4
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Sep 21 23:33:46 2011 +0200

    Ensure a failing soffice.bin makes oosplash fail.

diff --git a/desktop/unx/source/start.c b/desktop/unx/source/start.c
index 37b407b..6ca688d 100755
--- a/desktop/unx/source/start.c
+++ b/desktop/unx/source/start.c
@@ -920,6 +920,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS( argc, argv )
     const char* pUsePlugin;
     rtl_uString *pPipePath = NULL;
     Args *args;
+    int status = 0;
 
     /* turn SIGPIPE into an error */
     signal( SIGPIPE, SIG_IGN );
@@ -1022,7 +1023,8 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS( argc, argv )
             fprintf (stderr, "Exited with code '%d'\n", child_get_exit_code (info));
 #endif
 
-            switch (child_get_exit_code (info)) {
+            status = child_get_exit_code(info);
+            switch (status) {
             case 79: // re-start with just -env: parameters
 #if OSL_DEBUG_LEVEL > 0
                 fprintf (stderr, "oosplash: re-start with just -env: params !\n");
@@ -1049,7 +1051,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS( argc, argv )
     rtl_uString_release( pPipePath );
     args_free (args);
 
-    return 0;
+    return status;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 0607102c470a67dfd7c0579a32d1c862427e2013
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Sep 21 23:24:18 2011 +0200

    Improved some error reporting.

diff --git a/cppuhelper/source/shlib.cxx b/cppuhelper/source/shlib.cxx
index 8e8fc33..9414e34 100644
--- a/cppuhelper/source/shlib.cxx
+++ b/cppuhelper/source/shlib.cxx
@@ -263,7 +263,7 @@ static OUString makeComponentPath(
     OUString out( buf.makeStringAndClear() );
 #if OSL_DEBUG_LEVEL > 1
     OString str( OUStringToOString( out, RTL_TEXTENCODING_ASCII_US ) );
-    OSL_TRACE( "component path=%s", str.getStr() );
+    OSL_TRACE(OSL_LOG_PREFIX "component path=%s", str.getStr());
 #endif
 
     return out;
diff --git a/desktop/inc/app.hxx b/desktop/inc/app.hxx
index 10f6de9..87a774c 100644
--- a/desktop/inc/app.hxx
+++ b/desktop/inc/app.hxx
@@ -144,6 +144,7 @@ class Desktop : public Application
     private:
         // Bootstrap methods
         static ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > CreateApplicationServiceManager();
+            // returns a non-null reference or throws an exception
 
         void                    RegisterServices( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xSMgr );
         void                    DeregisterServices();
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index bf48647..1cb3f30 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -767,13 +767,19 @@ void Desktop::InitFinished()
 // on Unix command line args needs to be checked before Desktop::Init()
 void Desktop::ensureProcessServiceFactory()
 {
-    if( ::comphelper::getProcessServiceFactory().is())
-        return;
-
-    Reference < XMultiServiceFactory > rSMgr = CreateApplicationServiceManager();
-    if( rSMgr.is() )
-    {
-        ::comphelper::setProcessServiceFactory( rSMgr );
+    if (!comphelper::getProcessServiceFactory().is()) {
+        try {
+            comphelper::setProcessServiceFactory(
+                CreateApplicationServiceManager());
+        } catch (css::uno::Exception & e) {
+            OSL_TRACE(
+                OSL_LOG_PREFIX "caught UNO exception with message \"%s\"",
+                rtl::OUStringToOString(
+                    e.Message, RTL_TEXTENCODING_UTF8).getStr());
+            throw;
+                // let exceptions escape and tear down the process, it is
+                // completely broken anyway
+        }
     }
 }
 
diff --git a/desktop/source/app/appinit.cxx b/desktop/source/app/appinit.cxx
index cabc8dd..0f6709d 100644
--- a/desktop/source/app/appinit.cxx
+++ b/desktop/source/app/appinit.cxx
@@ -191,18 +191,9 @@ Reference< XMultiServiceFactory > Desktop::CreateApplicationServiceManager()
 {
     RTL_LOGFILE_CONTEXT( aLog, "desktop (cd100003) ::createApplicationServiceManager" );
 
-    try
-    {
-        Reference<XComponentContext> xComponentContext = ::cppu::defaultBootstrap_InitialComponentContext();
-        Reference<XMultiServiceFactory> xMS(xComponentContext->getServiceManager(), UNO_QUERY);
-
-        return xMS;
-    }
-    catch (const ::com::sun::star::uno::Exception&)
-    {
-    }
-
-    return Reference< XMultiServiceFactory >();
+    return Reference<XMultiServiceFactory>(
+        cppu::defaultBootstrap_InitialComponentContext()->getServiceManager(),
+        UNO_QUERY_THROW);
 }
 
 void Desktop::DestroyApplicationServiceManager( Reference< XMultiServiceFactory >& xSMgr )
commit 8ab7539540924bf30a8ed88c9e91915e16dfd91b
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Sep 21 23:22:11 2011 +0200

    In ChildStatusProc, calculate a meaningful status for processes killed by a signal.

diff --git a/sal/osl/unx/process.c b/sal/osl/unx/process.c
index de30ddb..097c237 100644
--- a/sal/osl/unx/process.c
+++ b/sal/osl/unx/process.c
@@ -643,6 +643,8 @@ static void ChildStatusProc(void *pData)
                     {
                         if (WIFEXITED(status))
                             pChild->m_status = WEXITSTATUS(status);
+                        else if (WIFSIGNALED(status))
+                            pChild->m_status = 128 + WTERMSIG(status);
                         else
                             pChild->m_status = -1;
 
commit cdd243cdeaaa55e989774cc76666c5ec863d651b
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Sep 21 23:20:13 2011 +0200

    Ensure a failing linkoo makes ooinstall fail.

diff --git a/solenv/bin/ooinstall b/solenv/bin/ooinstall
index 7887a46..cf9ad9e 100755
--- a/solenv/bin/ooinstall
+++ b/solenv/bin/ooinstall
@@ -136,5 +136,6 @@ if ($ENV{BUILD_TYPE} =~ m/ODK/) {
 print "Installer finished\n";
 
 if ($do_link && !$is_windows) {
-    `$ENV{SOLARENV}/bin/linkoo $path $ENV{SRC_ROOT}`;
+    system("$ENV{SOLARENV}/bin/linkoo $path $ENV{SRC_ROOT}") &&
+        die "linkoo failed: $!";
 }


More information about the Libreoffice-commits mailing list