-
-
Notifications
You must be signed in to change notification settings - Fork 863
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix #2639: getOwningProcessId sometimes return -1 on 64x linux #2645
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One fix needed. Also please submit a change log entry!
You can just push a new commit to your branch and it will update this PR.
conns.addAll(queryConnections("tcp", 4, pidMap)); | ||
conns.addAll(queryConnections("tcp", 6, pidMap)); | ||
conns.addAll(queryConnections("udp", 4, pidMap)); | ||
conns.addAll(queryConnections("udp", 6, pidMap)); | ||
return conns; | ||
} | ||
|
||
private static List<IPConnection> queryConnections(String protocol, int ipver, Map<Integer, Integer> pidMap) { | ||
private static List<IPConnection> queryConnections(String protocol, int ipver, Map<Long, Integer> pidMap) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to parse the inode
a few lines down to a long to match this key.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2645 +/- ##
==========================================
- Coverage 86.24% 85.20% -1.05%
==========================================
Files 30 30
Lines 1338 1338
Branches 189 189
==========================================
- Hits 1154 1140 -14
- Misses 103 116 +13
- Partials 81 82 +1 ☔ View full report in Codecov by Sentry. |
3d4a460
to
11a1ba1
Compare
Thank you for your feedback. I have made the necessary changes to the code. |
socklen_t is an unsigned (native) long which is 32-bit or 64-bit depending on OS bitness.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there!
CHANGELOG.md
Outdated
@@ -7,6 +7,7 @@ | |||
[#2625](https://github.com/oshi/oshi/pull/2625): Add part number to Physical Memory - [@BartekDziurowicz](https://github.com/BartekDziurowicz), [@dbwiddis](https://github.com/dbwiddis). | |||
|
|||
##### Bug fixes / Improvements | |||
* [#2645](https://github.com/oshi/oshi/pull/2645): fix getOwningProcessId sometimes return -1 on 64x linux - [@yourancc](https://github.com/yourancc). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be under the new 6.6.1 section
11a1ba1
to
b0a48e0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution to open source!
thank you for your patient guidance |
fix the issue(#2639 ) where the owning process ID sometimes returns -1 caused by it.