diff --git a/Source/PlasticSourceControl/Private/PlasticSourceControlShell.cpp b/Source/PlasticSourceControl/Private/PlasticSourceControlShell.cpp index 7bdb19ec..5f87ca23 100644 --- a/Source/PlasticSourceControl/Private/PlasticSourceControlShell.cpp +++ b/Source/PlasticSourceControl/Private/PlasticSourceControlShell.cpp @@ -112,10 +112,9 @@ static bool _StartBackgroundPlasticShell(const FString& InPathToPlasticBinary, c verify(FPlatformProcess::CreatePipe(ShellInputPipeRead, ShellInputPipeWrite, true)); // For writing commands to cm shell child process #endif - -#if PLATFORM_WINDOWS +#if PLATFORM_WINDOWS or PLATFORM_MAC ShellProcessHandle = FPlatformProcess::CreateProc(*InPathToPlasticBinary, *FullCommand, bLaunchDetached, bLaunchHidden, bLaunchReallyHidden, nullptr, 0, *InWorkingDirectory, ShellOutputPipeWrite, ShellInputPipeRead); -#else // PLATFORM_MAC or PLATFORM_LINUX +#else // PLATFORM_LINUX // Update working directory char OriginalWorkingDirectory[PATH_MAX]; getcwd(OriginalWorkingDirectory, PATH_MAX); @@ -155,11 +154,13 @@ static void _ExitBackgroundCommandLineShell(const bool bInForceExit = false) { if (bInForceExit) { + UE_LOG(LogSourceControl, Verbose, TEXT("_ExitBackgroundCommandLineShell: TerminateProc")); FPlatformProcess::TerminateProc(ShellProcessHandle); } else { // Tell the 'cm shell' to exit + UE_LOG(LogSourceControl, Verbose, TEXT("_ExitBackgroundCommandLineShell: exit...")); FPlatformProcess::WritePipe(ShellInputPipeWrite, TEXT("exit")); // And wait up to one second for its termination const double Timeout = 1.0; @@ -168,7 +169,7 @@ static void _ExitBackgroundCommandLineShell(const bool bInForceExit = false) { if ((FPlatformTime::Seconds() - StartTimestamp) > Timeout) { - UE_LOG(LogSourceControl, Warning, TEXT("ExitBackgroundCommandLineShell: cm shell didn't stop gracefully in %lfs."), Timeout); + UE_LOG(LogSourceControl, Warning, TEXT("_ExitBackgroundCommandLineShell: cm shell didn't stop gracefully in %lfs."), Timeout); FPlatformProcess::TerminateProc(ShellProcessHandle); break; } @@ -176,6 +177,10 @@ static void _ExitBackgroundCommandLineShell(const bool bInForceExit = false) } } } + else + { + UE_LOG(LogSourceControl, Verbose, TEXT("_ExitBackgroundCommandLineShell: 'cm shell' already stopped")); + } FPlatformProcess::CloseProc(ShellProcessHandle); _CleanupBackgroundCommandLineShell(); }