Skip to content

Commit 0af7df6

Browse files
committed
Do not append folder for explicit IBM temporary directory.
1 parent eed429e commit 0af7df6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

byte-buddy-agent/src/main/java/net/bytebuddy/agent/VirtualMachine.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1678,7 +1678,10 @@ public static VirtualMachine attach(String processId) throws IOException {
16781678
* @throws IOException If an IO exception occurs during establishing the connection.
16791679
*/
16801680
public static VirtualMachine attach(String processId, int timeout, Dispatcher dispatcher) throws IOException {
1681-
File directory = new File(System.getProperty(IBM_TEMPORARY_FOLDER, dispatcher.getTemporaryFolder(processId)), ".com_ibm_tools_attach");
1681+
String temporary = System.getProperty(IBM_TEMPORARY_FOLDER);
1682+
File directory = temporary == null
1683+
? new File(dispatcher.getTemporaryFolder(processId), ".com_ibm_tools_attach")
1684+
: new File(temporary);
16821685
long userId = dispatcher.userId();
16831686
RandomAccessFile attachLock = new RandomAccessFile(new File(directory, "_attachlock"), "rw");
16841687
try {

0 commit comments

Comments
 (0)