mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
:checkered-flag: Add race condition protection for getting process id
to make sure temp file isn't in conflict with another process and to make sure to get the right process id
This commit is contained in:
@@ -23,10 +23,11 @@ FOR %%a IN (%*) DO (
|
||||
)
|
||||
|
||||
rem Getting the process ID in cmd of the current cmd process: http://superuser.com/questions/881789/identify-and-kill-batch-script-started-before
|
||||
set T=%TEMP%\sthUnique.tmp
|
||||
set T=%TEMP%\atomCmdProcessId-%time::=%.tmp
|
||||
wmic process where (Name="WMIC.exe" AND CommandLine LIKE "%%%TIME%%%") get ParentProcessId /value | find "ParentProcessId" >%T%
|
||||
set /P A=<%T%
|
||||
set PID=%A:~16%
|
||||
del %T%
|
||||
|
||||
IF "%EXPECT_OUTPUT%"=="YES" (
|
||||
SET ELECTRON_ENABLE_LOGGING=YES
|
||||
|
||||
Reference in New Issue
Block a user