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

Fix issues with mismatched rlimit types on FreeBSD #253

Merged
merged 2 commits into from
Apr 18, 2019

Conversation

rhclayto
Copy link
Contributor

@rhclayto rhclayto commented Feb 9, 2019

On FreeBSD, the type for rlimit.max & rlimit.cur are int64. Currently cloudsql-proxy expects them to be uint64. This pull request casts the type of rlimit.cur & rlimit max to uint64, & casts the value of the passed inwantFDs to int64 when trying to assign it to rlim.Cur & rlim.Max.

See perkeep/perkeep#925 & https://camlistore-review.googlesource.com/c/camlistore/+/10147/ for other projects where this has reared its head.

Freebsd needs it's own file.
FreeBSD uses int64 for rlimit, the code here currently assumes uint64. This creates a file for FreeBSD builds so that unint64 & int64 are converted back & forth so there is no mismatch.
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

@rhclayto
Copy link
Contributor Author

rhclayto commented Feb 9, 2019

I have applied for the CLA. Waiting for it to take effect.

@googlebot
Copy link

CLAs look good, thanks!

@@ -0,0 +1,81 @@
// Copyright 2015 Google Inc. All Rights Reserved.
Copy link
Contributor

Choose a reason for hiding this comment

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

The license for a new file should be updated to 2019 Google LLC.

@kurtisvg kurtisvg added priority: p3 Desirable enhancement or fix. May not be included in next release. Status: Proposal type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Mar 14, 2019
@mhoran
Copy link

mhoran commented Mar 15, 2019

I just ran into this yesterday and would love to see this merged. The proposed change resolves the issue on my machine.

@mhoran
Copy link

mhoran commented Apr 18, 2019

@kurtisvg is the copyright notice the only blocker for getting this merged? You may be able to fix that yourself if the author did not disable the option for reviewers to make changes to PRs. Otherwise I can resubmit this PR with the requested changes if @rhclayto isn't around to do it.

@broady
Copy link
Contributor

broady commented Apr 18, 2019

LGTM. Copyright notice is not a blocker.

@broady broady merged commit 6ac0b49 into GoogleCloudPlatform:master Apr 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants