-
Notifications
You must be signed in to change notification settings - Fork 118
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
Add more error handling to bp2::ext cwd.ipp. #354
Add more error handling to bp2::ext cwd.ipp. #354
Conversation
something tells me i didn't do this correctly at all :P @klemens-morgenstern |
@klemens-morgenstern also wanted to mention, For reference: https://man.freebsd.org/cgi/man.cgi?query=libprocstat&sektion=3&format=html |
@@ -185,7 +187,8 @@ filesystem::path cwd(boost::process::v2::pid_type pid, boost::system::error_code | |||
} | |||
else | |||
BOOST_PROCESS_V2_ASSIGN_LAST_ERROR(ec) | |||
pclose(fp); | |||
if (pclose(fp) == -1) |
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.
That looks to be correct.
} | ||
else | ||
BOOST_PROCESS_V2_ASSIGN_LAST_ERROR(ec) | ||
procstat_close(proc_stat); | ||
if (errno) |
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.
Is this i a guess, or do you know this resets errno
if it succeeds? Because it might just be a function that never fails.
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.
for other people reading this pull request who don't know what i told klemens on slack, these functions never fail and are just wrappers around the free() function, after inspecting FreeBSD's source tree for libprocstat's source code.
these functions don't fail...
No description provided.