Skip to content
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

Merged
merged 2 commits into from
Mar 31, 2024

Conversation

time-killer-games
Copy link
Contributor

No description provided.

@time-killer-games
Copy link
Contributor Author

something tells me i didn't do this correctly at all :P @klemens-morgenstern

@time-killer-games
Copy link
Contributor Author

@klemens-morgenstern also wanted to mention, procstat_freefiles(), procstat_freeprocs(), and procstat_close() all return void and seem to have no defined error reporting mentioned in the FreeBSD documentation, all the more reason for us to switch to using libkvm like I mentioned to you recently in a private message on the cpp lang slack.

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)
Copy link
Collaborator

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)
Copy link
Collaborator

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.

Copy link
Contributor Author

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...
@klemens-morgenstern klemens-morgenstern merged commit 2ae279b into boostorg:develop Mar 31, 2024
0 of 24 checks passed
@time-killer-games time-killer-games deleted the patch-2 branch April 4, 2024 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants