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

jail: convert several functions from int to bool #663

Closed
wants to merge 1 commit into from

Conversation

igalic
Copy link
Contributor

@igalic igalic commented Feb 24, 2023

these functions exclusively return (0) and (1), so convert them to bool

We also convert some networking related jail functions from int to bool some of which were returning an error that was never used.

Differential Revision: https://reviews.freebsd.org/D29659

@igalic
Copy link
Contributor Author

igalic commented Feb 24, 2023

An earlier version of this Pull Request was approved by jamie@, but it was never merged.
Rebasing and putting on GitHub to get more eyes on it again.

sys/sys/jail.h Outdated
@@ -413,17 +413,17 @@ struct vfsconf;
*/
#define jailed(cred) (cred->cr_prison != &prison0)

int jailed_without_vnet(struct ucred *);
boolt jailed_without_vnet(struct ucred *);
Copy link
Contributor

Choose a reason for hiding this comment

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

There seems to be a typo here. Should be just bool, not boolt.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks for catching that

fixed!

Copy link
Contributor

Choose a reason for hiding this comment

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

You are welcome, now we just need the changes to make it compile.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

looking okay now.
And would look a lot better with #668 merged.

@igalic igalic force-pushed the style/jails-int-to-bool branch 3 times, most recently from 47f46e6 to 4af6d0c Compare February 25, 2023 22:43
these functions exclusively return (0) and (1), so convert them to bool

We also convert some networking related jail functions from int to bool
some of which were returning an error that was never used.

Differential Revision: https://reviews.freebsd.org/D29659
@bsdimp
Copy link
Member

bsdimp commented Mar 15, 2023

looks good... sorry it took so long to get into the tree...

@bsdimp bsdimp closed this Mar 15, 2023
freebsd-git pushed a commit that referenced this pull request Mar 15, 2023
these functions exclusively return (0) and (1), so convert them to bool

We also convert some networking related jail functions from int to bool
some of which were returning an error that was never used.

Differential Revision: https://reviews.freebsd.org/D29659
Reviewed by: imp, jamie (earlier version)
Pull Request: #663
@igalic igalic deleted the style/jails-int-to-bool branch March 15, 2023 07:23
bsdjhb pushed a commit to bsdjhb/cheribsd that referenced this pull request Apr 19, 2023
these functions exclusively return (0) and (1), so convert them to bool

We also convert some networking related jail functions from int to bool
some of which were returning an error that was never used.

Differential Revision: https://reviews.freebsd.org/D29659
Reviewed by: imp, jamie (earlier version)
Pull Request: freebsd/freebsd-src#663
@emaste emaste added the merged label Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants