[Libreoffice-commits] .: 2 commits - extensions/source offapi/UnoApi_offapi.mk

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Nov 16 05:57:49 PST 2012


 extensions/source/plugin/inc/plugin/unx/sysplug.hxx |    2 
 extensions/source/plugin/unx/sysplug.cxx            |   74 ++++++++++----------
 offapi/UnoApi_offapi.mk                             |    4 -
 3 files changed, 42 insertions(+), 38 deletions(-)

New commits:
commit ef670259c7f770397e19c58fabda7b5e91b88291
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Nov 16 14:56:58 2012 +0100

    Use sal/log.hxx instead of fprintf
    
    ...and some clean-up.
    
    Change-Id: Ia958628a3d0fdada3f8e90cfc0b0ceaa45563206

diff --git a/extensions/source/plugin/inc/plugin/unx/sysplug.hxx b/extensions/source/plugin/inc/plugin/unx/sysplug.hxx
index 0dc6a6e..9f98564 100644
--- a/extensions/source/plugin/inc/plugin/unx/sysplug.hxx
+++ b/extensions/source/plugin/inc/plugin/unx/sysplug.hxx
@@ -37,8 +37,6 @@
 class UnxPluginComm : public PluginComm, public PluginConnector
 {
 private:
-    static int  nConnCounter;
-
     pid_t       m_nCommPID;
 public:
     UnxPluginComm( const String& mimetype,
diff --git a/extensions/source/plugin/unx/sysplug.cxx b/extensions/source/plugin/unx/sysplug.cxx
index 24968fe..584bae0 100644
--- a/extensions/source/plugin/unx/sysplug.cxx
+++ b/extensions/source/plugin/unx/sysplug.cxx
@@ -33,8 +33,6 @@
 #undef _LINUX_SOURCE_COMPAT
 #endif
 
-#include <cstdarg>
-
 #include <sys/types.h>
 #include <signal.h>
 #include <sys/wait.h>
@@ -50,8 +48,6 @@
     return ::boost::shared_ptr<SysPlugData>();
 }
 
-int UnxPluginComm::nConnCounter = 0;
-
 UnxPluginComm::UnxPluginComm(
                              const String& /*mimetype*/,
                              const String& library,
@@ -60,13 +56,13 @@ UnxPluginComm::UnxPluginComm(
                              int nDescriptor2
                              ) :
         PluginComm( ::rtl::OUStringToOString( library, osl_getThreadTextEncoding() ), false ),
-        PluginConnector( nDescriptor2 )
+        PluginConnector( nDescriptor2 ),
+        m_nCommPID( 0 )
 {
     rtl::OString path;
     if (!getPluginappPath(&path))
     {
-        fprintf( stderr, "cannot construct path to pluginapp.bin\n" );
-        m_nCommPID = -1;
+        SAL_WARN("extensions.plugin", "cannot construct path to pluginapp.bin");
         return;
     }
 
@@ -83,50 +79,58 @@ UnxPluginComm::UnxPluginComm(
     pArgs[3] = pWindow;
     pArgs[4] = NULL;
 
-#if OSL_DEBUG_LEVEL > 1
-    m_nCommPID = 10;
-    fprintf( stderr, "Try to launch: %s %s %s %s, descriptors are %d, %d\n", pArgs[0], pArgs[1], pArgs[2], pArgs[3], nDescriptor1, nDescriptor2 );
-#endif
+    SAL_INFO(
+        "extensions.plugin",
+        "try to launch: " << pArgs[0] << " " << pArgs[1] << " " << pArgs[2]
+            << " " << pArgs[3] << ", descriptors are " << nDescriptor1 << ", "
+            << nDescriptor2);
 
-    if( ! ( m_nCommPID = fork() ) )
+    pid_t pid = fork();
+    if( pid == 0 )
     {
         execvp( pArgs[0], const_cast< char ** >(pArgs) );
-        fprintf( stderr, "Error: could not exec %s\n", pArgs[0] );
+        SAL_WARN("extensions.plugin", "could not exec " << pArgs[0]);
         _exit(255);
     }
 
-    if( m_nCommPID != -1 )
+    if( pid == -1 )
+    {
+        SAL_WARN("extensions.plugin", "fork failed");
+        return;
+    }
+
+    m_nCommPID = pid;
+    // wait for pluginapp.bin to start up
+    if( ! WaitForMessage( 5000 ) )
     {
-        // wait for pluginapp.bin to start up
-        if( ! WaitForMessage( 5000 ) )
-        {
-            fprintf( stderr, "Timeout on command: %s %s %s %s\n", pArgs[0], pArgs[1], pArgs[2], pArgs[3] );
-            invalidate();
-        }
-        else
-        {
-            MediatorMessage* pMessage = GetNextMessage( sal_True );
-            Respond( pMessage->m_nID,
-                     const_cast<char*>("init ack"),8,
-                     NULL );
-            delete pMessage;
-            NPP_Initialize();
-        }
+        SAL_WARN(
+            "extensions.plugin",
+            "timeout on command: " << pArgs[0] << " " << pArgs[1] << " "
+                << pArgs[2] << " " << pArgs[3]);
+        invalidate();
+    }
+    else
+    {
+        MediatorMessage* pMessage = GetNextMessage( sal_True );
+        Respond( pMessage->m_nID,
+                 const_cast<char*>("init ack"),8,
+                 NULL );
+        delete pMessage;
+        NPP_Initialize();
     }
 }
 
 UnxPluginComm::~UnxPluginComm()
 {
     NPP_Shutdown();
-    if( m_nCommPID != -1 && m_nCommPID != 0 )
+    if( m_nCommPID != 0 )
     {
         int status = 16777216;
         pid_t nExit = waitpid( m_nCommPID, &status, WUNTRACED );
-#if OSL_DEBUG_LEVEL > 1
-        fprintf( stderr, "child %d (plugin app child %d) exited with status %d\n", (int)nExit, (int)m_nCommPID, (int)WEXITSTATUS(status) );
-#else
-        (void)nExit;
-#endif
+        SAL_INFO(
+            "extensions.plugin",
+            "child " << nExit << " (plugin app child " << m_nCommPID
+                << ") exited with status " << WEXITSTATUS(status));
     }
 }
 
commit 34b2748eb38f9487fdfcb81141b64844d3d2a734
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Nov 16 14:56:20 2012 +0100

    New-style services are "_hohdl"
    
    Change-Id: Ib184b14c8e3dfcea7ed826ca60ba22b9ca48707e

diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 3620e07..f1e53a2 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -4293,10 +4293,12 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/xsd,\
 ))
 
 $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/org/freedesktop/PackageKit,\
-    SyncDbusSessionHelper \
     XSyncDbusSessionHelper \
     XModify \
     XQuery \
 ))
+$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/org/freedesktop/PackageKit,\
+    SyncDbusSessionHelper \
+))
 
 # vim: set noet sw=4 ts=4:


More information about the Libreoffice-commits mailing list