From 2386a92c1e6e8ec263edb4dc4fdcfeaa4673ce1f Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Wed, 9 Oct 2013 14:18:11 +0200 Subject: pyuno: set up fake command line in getComponentContext() Easy to trigger the assert in osl_getCommandArgCount(), just run instdir/*/program/python and "import unohelper". Avoid that by setting up a fake command line, hopefully nobody expects to be able to give relevant args to python... Change-Id: I0df6c23d6ecbb3c2bce81a9d5bcecdcb1729ddbb --- sal/osl/unx/process_impl.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sal') diff --git a/sal/osl/unx/process_impl.cxx b/sal/osl/unx/process_impl.cxx index b75e7725b2e0..00766ccf4304 100644 --- a/sal/osl/unx/process_impl.cxx +++ b/sal/osl/unx/process_impl.cxx @@ -176,7 +176,7 @@ sal_uInt32 SAL_CALL osl_getCommandArgCount (void) sal_uInt32 result = 0; pthread_mutex_lock (&(g_command_args.m_mutex)); - SAL_WARN_IF (g_command_args.m_nCount == 0, "sal.osl", "osl_setCommandArgs() not called before calling osl_getCommandArgCount()"); + assert (g_command_args.m_nCount != 0); if (g_command_args.m_nCount > 0) result = g_command_args.m_nCount - 1; pthread_mutex_unlock (&(g_command_args.m_mutex)); -- cgit