ppalaga commented on a change in pull request #612:
URL: https://github.com/apache/maven-mvnd/pull/612#discussion_r832483564



##########
File path: common/src/main/java/org/mvndaemon/mvnd/common/DaemonRegistry.java
##########
@@ -271,23 +271,33 @@ private void reset() {
     private static final int PROCESS_ID = getProcessId0();
 
     private static int getProcessId0() {
-        String pid = null;
         try {
             final Path self = Paths.get("/proc/self");
             if (Files.exists(self)) {

Review comment:
       I wonder whether we should look into /proc/self only on non-windows and 
non-mac systems?
   As your situation has shown, /proc/self may exists on Windows or Mac. 
Accessing it not only makes no sense, it also may fail for various reasons, 
such as insufficient permissions.
   So I'd vote for enclosing this in a non-windows and non-mac condition based 
on `org.mvndaemon.mvnd.common.Os.current()` and using 
`ManagementFactory.getRuntimeMXBean().getName()` otherwise.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to