Skip to content

Fix libpsl-native to build and pass tests on FreeBSD #2

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

Merged
merged 2 commits into from
Feb 5, 2019

Conversation

mateusrodrigues
Copy link
Contributor

@mateusrodrigues mateusrodrigues commented Jul 3, 2018

Moving this PR from PowerShell/#7208 as requested by @adityapatwardhan

The only change necessary after all was in file getuserfrompid.cpp, since isfile.cpp is following a PathExists implementation and was correct in the first place as tests were previously fixed.

With changes from this PR, all tests are passing on FreeBSD.

@iSazonov
Copy link
Contributor

iSazonov commented Jul 3, 2018

After merging PowerShell/PowerShell#7129 we will no longer use src/isfile.cpp.

@adityapatwardhan
Copy link
Member

I am working on a CI system for this repo. We should take this change once that is in place.

@mateusrodrigues Thank you for your PR.

@adityapatwardhan
Copy link
Member

@mateusrodrigues I have enable CI now and hence rebased your PR.

@@ -45,6 +49,22 @@ char* GetUserFromPid(pid_t pid)

return GetPwUid(oldp.kp_eproc.e_ucred.cr_uid);

#elif defined(__FreeBSD__)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of this can the following work?

#elif (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD__)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The return statement is the only one that really changes from macOS' implementation. I rewrote the ifdefs to replace only the return section.

@XVilka
Copy link

XVilka commented Feb 5, 2019

Is this PR abandoned?

@adityapatwardhan adityapatwardhan merged commit 6de9504 into PowerShell:master Feb 5, 2019
@adityapatwardhan
Copy link
Member

@mateusrodrigues Thank you for your contribution

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.

4 participants