summaryrefslogtreecommitdiff
path: root/desktop/unx/source/start.c
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/unx/source/start.c')
-rw-r--r--desktop/unx/source/start.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/desktop/unx/source/start.c b/desktop/unx/source/start.c
index 2d12d89e89cc..0e32c590f9de 100644
--- a/desktop/unx/source/start.c
+++ b/desktop/unx/source/start.c
@@ -839,10 +839,19 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS( argc, argv )
if ( ( fd = connect_pipe( pPipePath ) ) >= 0 )
{
- rtl_uString *pCwdPath = NULL;
- osl_getProcessWorkingDir( &pCwdPath );
-
- bSentArgs = send_args( fd, pCwdPath );
+ // Wait for answer
+ char resp[ strlen( "InternalIPC::SendArguments" ) + 1];
+ ssize_t n = read( fd, resp, SAL_N_ELEMENTS( resp ) );
+ if (n == (ssize_t) SAL_N_ELEMENTS( resp )
+ && (memcmp(
+ resp, "InternalIPC::SendArguments",
+ SAL_N_ELEMENTS( resp ) - 1) == 0)) {
+ rtl_uString *pCwdPath = NULL;
+ osl_getProcessWorkingDir( &pCwdPath );
+
+ // Then send args
+ bSentArgs = send_args( fd, pCwdPath );
+ }
close( fd );
}