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

bpo-34555: Fix incorrectly nested test for HAVE_LINUX_VM_SOCKETS_H #9016

Merged
merged 3 commits into from
Sep 1, 2018

Conversation

mcduke
Copy link
Contributor

@mcduke mcduke commented Aug 31, 2018

Unnested the check for HAVE_LINUX_VM_SOCKETS_H, to be independent of HAVE_SOCKADDR_ALG. Also added indentation to the HAVE_SOCKADDR_ALG block to make it clearer where it starts and ends.

https://bugs.python.org/issue34555

@the-knights-who-say-ni
Copy link

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA).

Unfortunately our records indicate you have not signed the CLA. For legal reasons we need you to sign this before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

You can check yourself to see if the CLA has been received.

Thanks again for your contribution, we look forward to reviewing it!

#ifdef HAVE_LINUX_VM_SOCKETS_H
# include <linux/vm_sockets.h>
#else
# undef AF_VSOCK
#endif

#ifdef HAVE_SOCKADDR_ALG
Copy link
Contributor

Choose a reason for hiding this comment

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

It would help to have a space after this line to make it symmetric with the line before the #endif.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This makes sense, amended my pull request.

# endif
# ifndef SOL_ALG
# define SOL_ALG 279
# endif
Copy link
Contributor

Choose a reason for hiding this comment

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

These ifdefs seem rather silly to me. If linux/if_alg.h exists, surely sys/socket.h is going to define AF_ALG and SOL_ALG, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know enough about this topic to be sure, but from a cursory search it appears to be a guideline in the Linux docs to include this block, in case of older header files that don't yet define these constants themselves.

@benjaminp benjaminp merged commit 2d7102e into python:master Sep 1, 2018
@miss-islington
Copy link
Contributor

Thanks @mcduke for the PR, and @benjaminp for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 1, 2018
…TS_H (pythonGH-9016)

(cherry picked from commit 2d7102e)

Co-authored-by: Thomas Herzog <thomas@mcduke.net>
@bedevere-bot
Copy link

GH-9029 is a backport of this pull request to the 3.7 branch.

miss-islington added a commit that referenced this pull request Sep 1, 2018
…TS_H (GH-9016)

(cherry picked from commit 2d7102e)

Co-authored-by: Thomas Herzog <thomas@mcduke.net>
vmurashev pushed a commit to vmurashev/cpython that referenced this pull request Sep 3, 2018
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.

5 participants