File tree Expand file tree Collapse file tree 1 file changed +4
-11
lines changed
common/utils/src/main/java/org/graalvm/buildtools/agent Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -163,17 +163,10 @@ private void addDefaultAccessFilter() {
163163 logger .info ("Ignore directory creation because " + agentDir + " directory is already created." );
164164 }
165165
166- Path tmpAccessFilter = null ;
167- try {
168- tmpAccessFilter = Files .createTempFile (agentDir , ACCESS_FILTER_PREFIX , ACCESS_FILTER_SUFFIX );
169- Files .copy (accessFilterData , tmpAccessFilter );
170- } catch (FileAlreadyExistsException e ) {
171- logger .info ("Temporary access-filter file already exists and we should just rename it." );
172- }
173-
174- if (tmpAccessFilter == null ) {
175- throw new IOException ("Cannot create temporary access-filter file." );
176- }
166+ long pid = ProcessHandle .current ().pid ();
167+ long time = System .currentTimeMillis ();
168+ Path tmpAccessFilter = agentDir .resolve (ACCESS_FILTER_PREFIX + pid + time + ACCESS_FILTER_SUFFIX );
169+ Files .copy (accessFilterData , tmpAccessFilter );
177170
178171 try {
179172 Files .move (tmpAccessFilter , accessFilterFile , StandardCopyOption .ATOMIC_MOVE );
You can’t perform that action at this time.
0 commit comments