ntdll: Update argc when changing process name.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49834
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2020-09-14 15:30:48 +02:00
parent 0f515c8ebe
commit 3cd3b77522
1 changed files with 4 additions and 3 deletions

View File

@ -736,7 +736,7 @@ char **build_envp( const WCHAR *envW )
* *
* Change the process name in the ps output. * Change the process name in the ps output.
*/ */
static void set_process_name( int argc, char *argv[] ) static int set_process_name( int argc, char *argv[] )
{ {
BOOL shift_strings; BOOL shift_strings;
char *p, *name; char *p, *name;
@ -790,6 +790,7 @@ static void set_process_name( int argc, char *argv[] )
#endif #endif
prctl( PR_SET_NAME, name ); prctl( PR_SET_NAME, name );
#endif /* HAVE_PRCTL */ #endif /* HAVE_PRCTL */
return argc - 1;
} }
@ -954,14 +955,14 @@ void init_environment( int argc, char *argv[], char *envp[] )
init_unix_codepage(); init_unix_codepage();
init_locale(); init_locale();
set_process_name( argc, argv );
if ((case_table = read_nls_file( "l_intl" ))) if ((case_table = read_nls_file( "l_intl" )))
{ {
uctable = case_table + 2; uctable = case_table + 2;
lctable = case_table + case_table[1] + 2; lctable = case_table + case_table[1] + 2;
} }
main_argc = argc;
main_argc = set_process_name( argc, argv );
main_argv = argv; main_argv = argv;
main_wargv = build_wargv( argv ); main_wargv = build_wargv( argv );
main_envp = envp; main_envp = envp;