Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
d89f5b20
Commit
d89f5b20
authored
Jan 09, 2009
by
Jeffrey Yasskin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue 4884, preventing a crash in the socket code when python is compiled
with llvm-gcc and run with a glibc <2.10.
parent
343b970d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
Include/pyport.h
Include/pyport.h
+9
-0
Modules/socketmodule.c
Modules/socketmodule.c
+5
-1
No files found.
Include/pyport.h
View file @
d89f5b20
...
...
@@ -709,6 +709,15 @@ typedef struct fd_set {
#define Py_FORMAT_PARSETUPLE(func,p1,p2)
#endif
/*
* Specify alignment on compilers that support it.
*/
#if defined(__GNUC__) && __GNUC__ >= 3
#define Py_ALIGNED(x) __attribute__((aligned(x)))
#else
#define Py_ALIGNED(x)
#endif
/* Eliminate end-of-loop code not reached warnings from SunPro C
* when using do{...}while(0) macros
*/
...
...
Modules/socketmodule.c
View file @
d89f5b20
...
...
@@ -3334,7 +3334,11 @@ socket_gethostbyaddr(PyObject *self, PyObject *args)
#ifdef HAVE_GETHOSTBYNAME_R_3_ARG
struct
hostent_data
data
;
#else
char
buf
[
16384
];
/* glibcs up to 2.10 assume that the buf argument to
gethostbyaddr_r is 8-byte aligned, which at least llvm-gcc
does not ensure. The attribute below instructs the compiler
to maintain this alignment. */
char
buf
[
16384
]
Py_ALIGNED
(
8
);
int
buf_len
=
(
sizeof
buf
)
-
1
;
int
errnop
;
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment