[Libreoffice-commits] .: desktop/unx

2012-04-19 Thread Michael Stahl
 desktop/unx/source/start.c |   16 +---
 1 file changed, 13 insertions(+), 3 deletions(-)

New commits:
commit f92d22565d4d389b0c93d45a1995521431585694
Author: Michael Stahl mst...@redhat.com
Date:   Thu Apr 19 15:00:18 2012 +0200

oosplash: improve signal handlers:

- global variable should be volatile
- signal is deprecated, use sigaction instead
- exit from the handler

diff --git a/desktop/unx/source/start.c b/desktop/unx/source/start.c
index 307cd88..d1a09a7 100644
--- a/desktop/unx/source/start.c
+++ b/desktop/unx/source/start.c
@@ -766,7 +766,7 @@ exec_javaldx (Args *args)
 #endif
 
 // has to be a global :(
-oslProcess * g_pProcess = 0;
+oslProcess * volatile g_pProcess = 0;
 
 void sigterm_handler(int ignored)
 {
@@ -776,8 +776,10 @@ void sigterm_handler(int ignored)
 // forward signal to soffice.bin
 osl_terminateProcess(g_pProcess);
 }
+_exit(255);
 }
 
+
 SAL_IMPLEMENT_MAIN_WITH_ARGS( argc, argv )
 {
 int fd = 0;
@@ -787,10 +789,18 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS( argc, argv )
 Args *args;
 int status = 0;
 struct splash* splash = NULL;
+struct sigaction sigpipe_action;
+struct sigaction sigterm_action;
 
 /* turn SIGPIPE into an error */
-signal( SIGPIPE, SIG_IGN );
-signal( SIGTERM, sigterm_handler );
+memset(sigpipe_action, 0, sizeof(struct sigaction));
+sigpipe_action.sa_handler = SIG_IGN;
+sigemptyset(sigpipe_action.sa_mask);
+sigaction(SIGPIPE, sigpipe_action, 0);
+memset(sigterm_action, 0, sizeof(struct sigaction));
+sigterm_action.sa_handler = sigterm_handler;
+sigemptyset(sigterm_action.sa_mask);
+sigaction(SIGTERM, sigterm_action, 0);
 
 args = args_parse ();
 args-pAppPath = get_app_path( argv[0] );
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: desktop/unx

2012-03-20 Thread Stephan Bergmann
 desktop/unx/source/start.c |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 7b9ea611bea133e758302b99df339439919101ed
Author: Stephan Bergmann sberg...@redhat.com
Date:   Tue Mar 20 11:22:19 2012 +0100

Resolves rhbz#804437, do not rtl_uString_release(NULL)

...in case osl_getProcessWorkingDir fails (e.g., if it has been unlinked).

diff --git a/desktop/unx/source/start.c b/desktop/unx/source/start.c
index f2c6e58..410c2fd 100644
--- a/desktop/unx/source/start.c
+++ b/desktop/unx/source/start.c
@@ -358,7 +358,10 @@ get_pipe_path( rtl_uString *pAppPath )
 rtl_uString_release( pMd5hash );
 rtl_uString_release( pPath );
 rtl_uString_release( pTmp );
-rtl_uString_release( pBasePath );
+if ( pBasePath )
+{
+rtl_uString_release( pBasePath );
+}
 rtl_uString_release( pUserInstallation );
 rtl_uString_release( pAbsUserInstallation );
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: desktop/unx

2012-02-29 Thread Stephan Bergmann
 desktop/unx/source/start.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 60f97f3ceb670a310e89cd1be948e04b469539f2
Author: Stephan Bergmann sberg...@redhat.com
Date:   Wed Feb 29 10:43:21 2012 +0100

Typo bInhibitJavaLdx - bInhibitPagein

diff --git a/desktop/unx/source/start.c b/desktop/unx/source/start.c
index 4033c37..be3ac7e 100644
--- a/desktop/unx/source/start.c
+++ b/desktop/unx/source/start.c
@@ -858,7 +858,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS( argc, argv )
 }
 
 /* pagein */
-if (!args-bInhibitJavaLdx)
+if (!args-bInhibitPagein)
 exec_pagein (args);
 
 /* javaldx */
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: desktop/unx

2012-02-29 Thread Stephan Bergmann
 desktop/unx/source/start.c |   39 ---
 1 file changed, 39 deletions(-)

New commits:
commit cf4416a68fb68f36cf9065c6d08d14dd22637b24
Author: Stephan Bergmann sberg...@redhat.com
Date:   Wed Feb 29 11:46:12 2012 +0100

fdo#46434: No need to turn arguments into absolute file URLs when sending

...as the receiving side already takes care of that (using the cwd that is 
sent first).

diff --git a/desktop/unx/source/start.c b/desktop/unx/source/start.c
index be3ac7e..773c9d0 100644
--- a/desktop/unx/source/start.c
+++ b/desktop/unx/source/start.c
@@ -450,7 +450,6 @@ send_args( int fd, rtl_uString *pCwdPath )
 sal_Bool bResult;
 size_t nLen;
 rtl_uString *pEscapedCwdPath = escape_path( pCwdPath );
-sal_Bool bDontConvertNext = sal_False;
 sal_uInt32 nArg = 0;
 sal_uInt32 nArgCount = osl_getCommandArgCount();
 
@@ -485,44 +484,6 @@ send_args( int fd, rtl_uString *pCwdPath )
 
 osl_getCommandArg( nArg, pTmp );
 
-// this is not a param, we have to prepend filenames with file://
-// FIXME: improve the check
-if ( ( pTmp-buffer[0] != (sal_Unicode)'-' ) )
-{
-sal_Int32 nFirstColon = rtl_ustr_indexOfChar_WithLength( 
pTmp-buffer, pTmp-length, ':' );
-sal_Int32 nFirstSlash = rtl_ustr_indexOfChar_WithLength( 
pTmp-buffer, pTmp-length, '/' );
-
-// check that pTmp is not an URI yet
-// note .uno .slot  vnd.sun.star.script are special urls 
that
-// don't expect a following '/'
-
- const char* schemes[] = { slot:,  .uno:, 
vnd.sun.star.script: };
- sal_Bool bIsSpecialURL = sal_False;
- int i = 0;
- int len =  SAL_N_ELEMENTS(schemes);
- for ( ; i  len; ++i )
- {
- if ( rtl_ustr_indexOfAscii_WithLength( pTmp-buffer
- , pTmp-length , schemes[ i ], strlen(schemes[ i ] ))  == 
0  )
- {
- bIsSpecialURL = sal_True;
- break;
- }
- }
-
-if ( !bIsSpecialURL  ( nFirstColon  1 || ( nFirstSlash != 
nFirstColon + 1 ) ) )
-{
-// some of the switches (currently just -pt) don't want to
-// have the filenames as URIs
-if ( !bDontConvertNext )
-osl_getAbsoluteFileURL( pCwdPath, pTmp, pTmp );
-}
-}
-
-// don't convert filenames with some of the switches
-// (currently just -pt)
-bDontConvertNext = !rtl_ustr_ascii_compareIgnoreAsciiCase( 
pTmp-buffer, -pt );
-
 pEscapedTmp = escape_path( pTmp );
 
 rtl_uStringbuffer_insert( pBuffer, nCapacity,
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: desktop/unx

2012-02-29 Thread Stephan Bergmann
 desktop/unx/source/start.c |   10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

New commits:
commit 8bbf048085066b8e95256e7d59d7ddd89465d4e7
Author: Stephan Bergmann sberg...@redhat.com
Date:   Wed Feb 29 15:08:20 2012 +0100

fdo#46434: Always send command line arguments as UTF-8

diff --git a/desktop/unx/source/start.c b/desktop/unx/source/start.c
index 773c9d0..f2c6e58 100644
--- a/desktop/unx/source/start.c
+++ b/desktop/unx/source/start.c
@@ -496,7 +496,15 @@ send_args( int fd, rtl_uString *pCwdPath )
 
 ustr_debug( Pass args, pBuffer );
 
-pOut = ustr_to_str( pBuffer );
+if ( !rtl_convertUStringToString(
+ pOut, rtl_uString_getStr( pBuffer ),
+ rtl_uString_getLength( pBuffer ), RTL_TEXTENCODING_UTF8,
+ ( RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR
+   | RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR ) ) )
+{
+fprintf( stderr, ERROR: cannot convert arguments to UTF-8 );
+exit( 1 );
+}
 
 nLen = rtl_string_getLength( pOut ) + 1;
 bResult = ( write( fd, rtl_string_getStr( pOut ), nLen ) == (ssize_t) nLen 
);
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: desktop/unx

2012-02-18 Thread David Tardon
 desktop/unx/source/start.c |4 
 1 file changed, 4 insertions(+)

New commits:
commit ce4c9fa90af70832744e4a9f344b05eb42577f2e
Author: David Tardon dtar...@redhat.com
Date:   Sat Feb 18 14:47:17 2012 +0100

WaE: exec_javaldx defined but not used (javaless build)

diff --git a/desktop/unx/source/start.c b/desktop/unx/source/start.c
index d043b88..4033c37 100644
--- a/desktop/unx/source/start.c
+++ b/desktop/unx/source/start.c
@@ -666,6 +666,8 @@ exec_pagein (Args *args)
 free (argv[1]);
 }
 
+#if defined SOLAR_JAVA
+
 static void extend_library_path (const char *new_element)
 {
 rtl_uString *pEnvName=NULL, *pOrigEnvVar=NULL, *pNewEnvVar=NULL;
@@ -789,6 +791,8 @@ exec_javaldx (Args *args)
 osl_closeFile(fileOut);
 }
 
+#endif
+
 SAL_IMPLEMENT_MAIN_WITH_ARGS( argc, argv )
 {
 int fd = 0;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: desktop/unx

2012-01-09 Thread Julien Nabet
 desktop/unx/source/file_image_unx.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 05c51d5dfb58549e5bf26cb5c8b9b4f0083dca25
Author: Julien Nabet serval2...@yahoo.fr
Date:   Tue Jan 10 00:02:01 2012 +0100

Some cppcheck cleaning

diff --git a/desktop/unx/source/file_image_unx.c 
b/desktop/unx/source/file_image_unx.c
index 078585f..fe3384b 100644
--- a/desktop/unx/source/file_image_unx.c
+++ b/desktop/unx/source/file_image_unx.c
@@ -90,6 +90,7 @@ int file_image_pagein (file_image * image)
 file_imagew;
 long  s;
 size_tk;
+// force touching of each page despite the optimizer
 volatile char c = 0;
 
 if (image == 0)
@@ -116,8 +117,6 @@ int file_image_pagein (file_image * image)
 if (w.m_size  0)
 {
 c ^= ((char*)(w.m_base))[0];
-w.m_base  = (char*)(w.m_base) + w.m_size;
-w.m_size -= w.m_size;
 }
 
 return (0);
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: desktop/unx

2011-11-18 Thread Lionel Elie Mamane
 desktop/unx/source/splashx.c |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 48efe5ce26b519a1a87da1d0ee1acefcb000934e
Author: August Sodora aug...@gmail.com
Date:   Thu Nov 17 21:06:16 2011 -0500

Valgrind: fixed memory leak

diff --git a/desktop/unx/source/splashx.c b/desktop/unx/source/splashx.c
index 0c7024d..3d3981d 100644
--- a/desktop/unx/source/splashx.c
+++ b/desktop/unx/source/splashx.c
@@ -744,6 +744,12 @@ void splash_destroy(struct splash* splash)
 {
 if(splash-display)
 {
+if(splash-gc)
+{
+XFreeGC(splash-display, splash-gc);
+splash-gc = NULL;
+}
+
 XCloseDisplay( splash-display );
 splash-display = NULL;
 png_destroy_read_struct( (splash-png_ptr), (splash-info_ptr), 
NULL );
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: desktop/unx

2011-11-09 Thread Stephan Bergmann
 desktop/unx/source/args.c  |   33 ++---
 desktop/unx/source/args.h  |1 -
 desktop/unx/source/start.c |7 ---
 3 files changed, 14 insertions(+), 27 deletions(-)

New commits:
commit 5d4af26ae9bfa6f747bfd8a56067b783228033fd
Author: Stephan Bergmann sberg...@redhat.com
Date:   Wed Nov 9 13:48:21 2011 +0100

Revert oosplash - daemonize to help mutt users recover their sanity

For one, it leaves detached oosplash processes behind (the forked oosplash
instance waits for the soffice.bin child forked from the original oosplash
instance in vain).  For another, it makes unavailable the soffice.bin exit 
code.

This reverts commits aacf55dbe004ae3cad720002d40dc0e408107fd3 and
62ebb119cfb42adc5e007fb77f68d56b40de2a85.

diff --git a/desktop/unx/source/args.c b/desktop/unx/source/args.c
index c889e6c..367bac2 100644
--- a/desktop/unx/source/args.c
+++ b/desktop/unx/source/args.c
@@ -48,33 +48,29 @@ static struct {
 unsigned int  bInhibitSplash : 1;
 unsigned int  bInhibitPagein : 1;
 unsigned int  bInhibitJavaLdx : 1;
-unsigned int  bInhibitDemon : 1;
 const char   *pPageinType;
 } pArgDescr[] = {
 /* have a trailing argument */
-{ pt, 1, 0, 0, 0, 0, NULL },
-{ display,1, 0, 0, 0, 0, NULL },
+{ pt, 1, 0, 0, 0, NULL },
+{ display,1, 0, 0, 0, NULL },
 
 /* no splash */
-{ nologo, 0, 1, 0, 0, 0, NULL },
-{ headless,   0, 1, 0, 0, 0, NULL },
-{ invisible,  0, 1, 0, 0, 0, NULL },
-{ minimized,  0, 1, 0, 0, 0, NULL },
+{ nologo, 0, 1, 0, 0, NULL },
+{ headless,   0, 1, 0, 0, NULL },
+{ invisible,  0, 1, 0, 0, NULL },
+{ minimized,  0, 1, 0, 0, NULL },
 
 /* pagein bits */
-{ writer, 0, 0, 0, 0, 0, pagein-writer  },
-{ calc,   0, 0, 0, 0, 0, pagein-calc},
-{ draw,   0, 0, 0, 0, 0, pagein-draw},
-{ impress,0, 0, 0, 0, 0, pagein-impress },
+{ writer, 0, 0, 0, 0, pagein-writer  },
+{ calc,   0, 0, 0, 0, pagein-calc},
+{ draw,   0, 0, 0, 0, pagein-draw},
+{ impress,0, 0, 0, 0, pagein-impress },
 
 /* nothing much */
-{ version,0, 1, 1, 1, 0, NULL },
-{ help,   0, 1, 1, 1, 0, NULL },
-{ h,  0, 1, 1, 1, 0, NULL },
-{ ?,  0, 1, 1, 1, 0, NULL },
-
-/* UNO remote controlled process */
-{ accept, 0, 0, 0, 0, 1, NULL },
+{ version,0, 1, 1, 1, NULL },
+{ help,   0, 1, 1, 1, NULL },
+{ h,  0, 1, 1, 1, NULL },
+{ ?,  0, 1, 1, 1, NULL },
 };
 
 Args *args_parse (void)
@@ -135,7 +131,6 @@ Args *args_parse (void)
 args-bInhibitSplash  |= pArgDescr[j].bInhibitSplash;
 args-bInhibitPagein  |= pArgDescr[j].bInhibitPagein;
 args-bInhibitJavaLdx |= pArgDescr[j].bInhibitJavaLdx;
-args-bInhibitDemon   |= pArgDescr[j].bInhibitDemon;
 if (pArgDescr[j].pPageinType)
 args-pPageinType = pArgDescr[j].pPageinType;
 }
diff --git a/desktop/unx/source/args.h b/desktop/unx/source/args.h
index 0f1f114..4a0cb55 100644
--- a/desktop/unx/source/args.h
+++ b/desktop/unx/source/args.h
@@ -38,7 +38,6 @@ typedef struct {
   sal_Bool bInhibitSplash;  // should we show a splash screen
   sal_Bool bInhibitPagein;  // should we run pagein ?
   sal_Bool bInhibitJavaLdx; // should we run javaldx ?
-  sal_Bool bInhibitDemon;   // we want to match the lifecycle of 
soffice.bin
 
   sal_uInt32   nArgsEnv;// number of -env: style args
   sal_uInt32   nArgsTotal;  // number of -env: as well as -writer style 
args
diff --git a/desktop/unx/source/start.c b/desktop/unx/source/start.c
index b30efdc..940a997 100644
--- a/desktop/unx/source/start.c
+++ b/desktop/unx/source/start.c
@@ -882,13 +882,6 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS( argc, argv )
 splash_destroy(splash);
 splash = NULL;
 bShortWait = sal_False;
-
-if (!args-bInhibitDemon)
-{
-/* Since a client can't distinguish between a 
first-start and
-   a factory re-use, we return control to them here. */
-daemon( 1 /* don't chdir */, 1 /* don't re-direct 
output */ );
-}
 }
 
 #if OSL_DEBUG_LEVEL  1
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: desktop/unx

2011-11-08 Thread Christian Lohmaier
 desktop/unx/source/start.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 17f977c104374eedd5638aadc3175dda88ad6360
Author: Christian Lohmaier lohmaier+libreoff...@googlemail.com
Date:   Tue Nov 8 14:40:07 2011 +0100

remove leftover comment regarding removed Mac OSX conditional

diff --git a/desktop/unx/source/start.c b/desktop/unx/source/start.c
index 29cda81..cd95d45 100644
--- a/desktop/unx/source/start.c
+++ b/desktop/unx/source/start.c
@@ -645,7 +645,6 @@ static char *build_pagein_path (Args *args, const char 
*pagein_name)
 void
 exec_pagein (Args *args)
 {
-// no pagein for the while on OSX
 char *argv[3];
 
 /* don't use -L - since that does a chdir that breaks relative paths */
@@ -698,7 +697,7 @@ static void
 exec_javaldx (Args *args)
 {
 #ifndef SOLAR_JAVA
-   return;
+return;
 #endif
 char newpath[4096];
 sal_uInt32 nArgs;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: desktop/unx

2011-11-08 Thread Michael Meeks
 desktop/unx/source/start.c |4 
 1 file changed, 4 insertions(+)

New commits:
commit aacf55dbe004ae3cad720002d40dc0e408107fd3
Author: Michael Meeks michael.me...@suse.com
Date:   Tue Nov 8 11:32:20 2011 +

oosplash - daemonize to help mutt users recover their sanity

diff --git a/desktop/unx/source/start.c b/desktop/unx/source/start.c
index cd95d45..d627131 100644
--- a/desktop/unx/source/start.c
+++ b/desktop/unx/source/start.c
@@ -881,6 +881,10 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS( argc, argv )
 splash_destroy(splash);
 splash = NULL;
 bShortWait = sal_False;
+
+/* Since a client can't distinguish between a first-start 
and
+   a factory re-use, we return control to them here. */
+daemon( 1 /* don't chdir */, 1 /* don't re-direct output 
*/ );
 }
 
 #if OSL_DEBUG_LEVEL  1
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: desktop/unx

2011-11-08 Thread Michael Meeks
 desktop/unx/source/args.c  |   33 +++--
 desktop/unx/source/args.h  |1 +
 desktop/unx/source/start.c |9 ++---
 3 files changed, 26 insertions(+), 17 deletions(-)

New commits:
commit 62ebb119cfb42adc5e007fb77f68d56b40de2a85
Author: Michael Meeks michael.me...@suse.com
Date:   Tue Nov 8 17:52:37 2011 +

don't demonize if we are passed an --accept line for UNO remote control

diff --git a/desktop/unx/source/args.c b/desktop/unx/source/args.c
index 367bac2..c889e6c 100644
--- a/desktop/unx/source/args.c
+++ b/desktop/unx/source/args.c
@@ -48,29 +48,33 @@ static struct {
 unsigned int  bInhibitSplash : 1;
 unsigned int  bInhibitPagein : 1;
 unsigned int  bInhibitJavaLdx : 1;
+unsigned int  bInhibitDemon : 1;
 const char   *pPageinType;
 } pArgDescr[] = {
 /* have a trailing argument */
-{ pt, 1, 0, 0, 0, NULL },
-{ display,1, 0, 0, 0, NULL },
+{ pt, 1, 0, 0, 0, 0, NULL },
+{ display,1, 0, 0, 0, 0, NULL },
 
 /* no splash */
-{ nologo, 0, 1, 0, 0, NULL },
-{ headless,   0, 1, 0, 0, NULL },
-{ invisible,  0, 1, 0, 0, NULL },
-{ minimized,  0, 1, 0, 0, NULL },
+{ nologo, 0, 1, 0, 0, 0, NULL },
+{ headless,   0, 1, 0, 0, 0, NULL },
+{ invisible,  0, 1, 0, 0, 0, NULL },
+{ minimized,  0, 1, 0, 0, 0, NULL },
 
 /* pagein bits */
-{ writer, 0, 0, 0, 0, pagein-writer  },
-{ calc,   0, 0, 0, 0, pagein-calc},
-{ draw,   0, 0, 0, 0, pagein-draw},
-{ impress,0, 0, 0, 0, pagein-impress },
+{ writer, 0, 0, 0, 0, 0, pagein-writer  },
+{ calc,   0, 0, 0, 0, 0, pagein-calc},
+{ draw,   0, 0, 0, 0, 0, pagein-draw},
+{ impress,0, 0, 0, 0, 0, pagein-impress },
 
 /* nothing much */
-{ version,0, 1, 1, 1, NULL },
-{ help,   0, 1, 1, 1, NULL },
-{ h,  0, 1, 1, 1, NULL },
-{ ?,  0, 1, 1, 1, NULL },
+{ version,0, 1, 1, 1, 0, NULL },
+{ help,   0, 1, 1, 1, 0, NULL },
+{ h,  0, 1, 1, 1, 0, NULL },
+{ ?,  0, 1, 1, 1, 0, NULL },
+
+/* UNO remote controlled process */
+{ accept, 0, 0, 0, 0, 1, NULL },
 };
 
 Args *args_parse (void)
@@ -131,6 +135,7 @@ Args *args_parse (void)
 args-bInhibitSplash  |= pArgDescr[j].bInhibitSplash;
 args-bInhibitPagein  |= pArgDescr[j].bInhibitPagein;
 args-bInhibitJavaLdx |= pArgDescr[j].bInhibitJavaLdx;
+args-bInhibitDemon   |= pArgDescr[j].bInhibitDemon;
 if (pArgDescr[j].pPageinType)
 args-pPageinType = pArgDescr[j].pPageinType;
 }
diff --git a/desktop/unx/source/args.h b/desktop/unx/source/args.h
index 4a0cb55..0f1f114 100644
--- a/desktop/unx/source/args.h
+++ b/desktop/unx/source/args.h
@@ -38,6 +38,7 @@ typedef struct {
   sal_Bool bInhibitSplash;  // should we show a splash screen
   sal_Bool bInhibitPagein;  // should we run pagein ?
   sal_Bool bInhibitJavaLdx; // should we run javaldx ?
+  sal_Bool bInhibitDemon;   // we want to match the lifecycle of 
soffice.bin
 
   sal_uInt32   nArgsEnv;// number of -env: style args
   sal_uInt32   nArgsTotal;  // number of -env: as well as -writer style 
args
diff --git a/desktop/unx/source/start.c b/desktop/unx/source/start.c
index d627131..9d95547 100644
--- a/desktop/unx/source/start.c
+++ b/desktop/unx/source/start.c
@@ -882,9 +882,12 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS( argc, argv )
 splash = NULL;
 bShortWait = sal_False;
 
-/* Since a client can't distinguish between a first-start 
and
-   a factory re-use, we return control to them here. */
-daemon( 1 /* don't chdir */, 1 /* don't re-direct output 
*/ );
+if (!args-bInhibitDemon)
+{
+/* Since a client can't distinguish between a 
first-start and
+   a factory re-use, we return control to them here. */
+daemon( 1 /* don't chdir */, 1 /* don't re-direct 
output */ );
+}
 }
 
 #if OSL_DEBUG_LEVEL  1
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: desktop/unx

2011-11-08 Thread Stephan Bergmann
 desktop/unx/source/start.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit de90369c315afc62c4409a5df1a581fa466cb849
Author: Stephan Bergmann sberg...@redhat.com
Date:   Tue Nov 8 20:49:07 2011 +0100

Properly check sscanf return value.

diff --git a/desktop/unx/source/start.c b/desktop/unx/source/start.c
index 9d95547..b30efdc 100644
--- a/desktop/unx/source/start.c
+++ b/desktop/unx/source/start.c
@@ -559,6 +559,7 @@ read_percent( ChildInfo *info, int *pPercent )
 
 char *pBegin;
 char *pIter;
+char c;
 
 /* from the last call */
 int nNotProcessed = nRead - ( pNext - pBuffer );
@@ -598,7 +599,7 @@ read_percent( ChildInfo *info, int *pPercent )
 return ProgressExit;
 else if ( !strncasecmp( pBegin, restart, 7 ) )
 return ProgressRestart;
-else if ( sscanf( pBegin, %d%%, pPercent ) )
+else if ( sscanf( pBegin, %d%c, pPercent, c ) == 2  c == '%' )
 return ProgressContinue;
 
 /* unexpected - let's exit the splash to be safe */
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: desktop/unx

2011-09-25 Thread Norbert Thiebaud
 desktop/unx/source/splashx.c |  602 ++-
 desktop/unx/source/splashx.h |   25 -
 desktop/unx/source/start.c   |  152 --
 3 files changed, 380 insertions(+), 399 deletions(-)

New commits:
commit c6811e675cbeaef31fd4d758f75939839b1aa10f
Author: Norbert Thiebaud nthieb...@gmail.com
Date:   Fri Sep 23 03:51:54 2011 -0500

refactor start.c and splash.c. de-couple the 2 sources and avoid globals

diff --git a/desktop/unx/source/splashx.c b/desktop/unx/source/splashx.c
index c1a1ba6..aa8109a 100755
--- a/desktop/unx/source/splashx.c
+++ b/desktop/unx/source/splashx.c
@@ -46,9 +46,12 @@
 #include string.h
 #include unistd.h
 
-#ifdef USE_LIBPNG
-#  include png.h
-#endif
+#include png.h
+
+#include osl/process.h
+#include osl/thread.h
+#include rtl/bootstrap.h
+#include rtl/ustrbuf.h
 
 #include splashx.h
 
@@ -56,39 +59,45 @@ typedef struct {
 unsigned char b, g, r;
 } color_t;
 
-#define WINDOW_WIDTH  440
-#define WINDOW_HEIGHT 299
-
-#define PROGRESS_XOFFSET 12
-#define PROGRESS_YOFFSET 18
-#define PROGRESS_BARSPACE 2
-
-static Display *display = NULL;
-static int screen;
-static int depth;
-static Visual *visual = NULL;
+struct splash
+{
+Display* display;
+int screen;
+int depth;
+Visual* visual;
 
-static int width = WINDOW_WIDTH;
-static int height = WINDOW_HEIGHT;
+int width;
+int height;
 
-static Colormap color_map;
-static Window win;
-static GC gc;
+Colormap color_map;
+Window win;
+GC gc;
 
 // Progress bar values
 // taken from desktop/source/splash/splash.cxx
-static int tlx = 212;
-static int tly = 216;
-static int barwidth = 263;
-static int barheight = 8;
-static int barspace = PROGRESS_BARSPACE;
-static color_t barcol = { 18, 202, 157 };
-static color_t framecol = { 0xD3, 0xD3, 0xD3 };
+int tlx;
+int tly;
+int barwidth;
+int barheight;
+int barspace;
+color_t barcol;
+color_t framecol;
+
+XColor barcolor;
+XColor framecolor;
+
+unsigned char** bitmap_rows;
+png_structp png_ptr;
+png_infop info_ptr;
 
-static XColor barcolor;
-static XColor framecolor;
+};
+
+#define WINDOW_WIDTH  440
+#define WINDOW_HEIGHT 299
 
-static unsigned char **bitmap_rows = NULL;
+#define PROGRESS_XOFFSET 12
+#define PROGRESS_YOFFSET 18
+#define PROGRESS_BARSPACE 2
 
 #define BMP_HEADER_LEN 14
 #define WIN_INFO_LEN 40
@@ -112,100 +121,40 @@ static unsigned char **bitmap_rows = NULL;
 return 0; \
 }
 
-#ifdef USE_LIBPNG
-
 /* libpng-1.2.41 */
 #ifndef PNG_TRANSFORM_GRAY_TO_RGB
 #  define PNG_TRANSFORM_GRAY_TO_RGB   0x2000
 #endif
 
-png_structp png_ptr = NULL;
-png_infop info_ptr = NULL;
-
-int splash_load_bmp( const char *filename )
+static int splash_load_bmp( struct splash* splash, const char *filename )
 {
 FILE *file;
 
 if ( !(file = fopen( filename, r ) ) )
 return 0;
 
-png_ptr = png_create_read_struct( PNG_LIBPNG_VER_STRING, 0, 0, 0 );
-info_ptr = png_create_info_struct(png_ptr);
-png_init_io( png_ptr, file );
+splash-png_ptr = png_create_read_struct( PNG_LIBPNG_VER_STRING, 0, 0, 0 );
+splash-info_ptr = png_create_info_struct(splash-png_ptr);
+png_init_io( splash-png_ptr, file );
 
-if( setjmp( png_jmpbuf( png_ptr ) ) )
+if( setjmp( png_jmpbuf( splash-png_ptr ) ) )
 {
-png_destroy_read_struct( png_ptr, info_ptr, NULL );
+png_destroy_read_struct( (splash-png_ptr), (splash-info_ptr), NULL 
);
 fclose( file );
 return 0;
 }
 
-png_read_png( png_ptr, info_ptr,
+png_read_png( splash-png_ptr, splash-info_ptr,
   PNG_TRANSFORM_EXPAND | PNG_TRANSFORM_STRIP_ALPHA |
   PNG_TRANSFORM_GRAY_TO_RGB | PNG_TRANSFORM_BGR, NULL);
 
-bitmap_rows = png_get_rows( png_ptr, info_ptr );
-width = png_get_image_width( png_ptr, info_ptr );
-height = png_get_image_height( png_ptr, info_ptr );
+splash-bitmap_rows = png_get_rows( splash-png_ptr, splash-info_ptr );
+splash-width = png_get_image_width( splash-png_ptr, splash-info_ptr );
+splash-height = png_get_image_height( splash-png_ptr, splash-info_ptr );
 
 fclose( file );
 return 1;
 }
-#else
-
-/* Load the specified Windows 24bit BMP to 'bitmap'
- * Return: 1 - success, 0 - failure */
-int splash_load_bmp( const char *filename )
-{
-int fd = open( filename, O_RDONLY );
-if ( fd  0 )
-return 0;
-
-char file_header[ BMP_HEADER_LEN ];
-
-if ( read( fd, file_header, BMP_HEADER_LEN ) != BMP_HEADER_LEN || 
file_header[0] != 'B' || file_header[1] != 'M' )
-LOAD_FAILURE( Not a bitmap.\n );
-
-char info_header[ WIN_INFO_LEN ];
-if ( read( fd, info_header, 4 ) != 4 )
-LOAD_FAILURE( Unable to read the header.\n );
-
-int header_size = UINT32( info_header );
-if ( header_size != WIN_INFO_LEN )
-LOAD_FAILURE( Not a Windows bitmap.\n );
-
-if ( read( fd, info_header + 4, WIN_INFO_LEN - 4 ) != WIN_INFO_LEN - 4 )
-

[Libreoffice-commits] .: desktop/unx

2011-09-25 Thread Norbert Thiebaud
 desktop/unx/source/splashx.c |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit cbeebc223b4e759dddb0c5ec03061b67ab88c859
Author: Norbert Thiebaud nthieb...@gmail.com
Date:   Sun Sep 25 16:21:19 2011 -0500

make the case not ENABLE_QUICKSTART_LIBPNG work again

diff --git a/desktop/unx/source/splashx.c b/desktop/unx/source/splashx.c
index aa8109a..9f58f0c 100755
--- a/desktop/unx/source/splashx.c
+++ b/desktop/unx/source/splashx.c
@@ -781,6 +781,12 @@ struct splash* splash_create(rtl_uString* pAppPath, int 
argc, char** argv)
 
 #else /* not ENABLE_QUICKSTART_LIBPNG */
 
+#include rtl/ustrbuf.h
+
+struct splash
+{
+};
+
 /* Stubs that will never be called in this case */
 void splash_draw_progress( struct splash* splash, int progress )
 {
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits