Skip to content

Commit bd165b9

Browse files
author
Alexander Nozdrin
committed
Preliminary patch for WL#5787 (IPv6-capable
INET_ATON and INET_NTOA functions). The patch move the "#include <netdb.h>" directive into my_net.h and remove that directrive from other files.
1 parent 454a450 commit bd165b9

8 files changed

Lines changed: 26 additions & 48 deletions

File tree

include/my_net.h

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
1212
You should have received a copy of the GNU General Public License
1313
along with this program; if not, write to the Free Software
14-
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
14+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
1515

1616
/*
1717
This file is also used to make handling of sockets and ioctl()
@@ -27,18 +27,23 @@
2727
C_MODE_START
2828

2929
#include <errno.h>
30+
3031
#ifdef HAVE_SYS_SOCKET_H
3132
#include <sys/socket.h>
3233
#endif
34+
3335
#ifdef HAVE_NETINET_IN_H
3436
#include <netinet/in.h>
3537
#endif
38+
3639
#ifdef HAVE_ARPA_INET_H
3740
#include <arpa/inet.h>
3841
#endif
42+
3943
#ifdef HAVE_POLL
4044
#include <sys/poll.h>
4145
#endif
46+
4247
#ifdef HAVE_SYS_IOCTL_H
4348
#include <sys/ioctl.h>
4449
#endif
@@ -47,9 +52,9 @@ C_MODE_START
4752
#include <netinet/in_systm.h>
4853
#include <netinet/in.h>
4954
#include <netinet/ip.h>
50-
#if !defined(alpha_linux_port)
51-
#include <netinet/tcp.h>
52-
#endif
55+
# if !defined(alpha_linux_port)
56+
# include <netinet/tcp.h>
57+
# endif
5358
#endif
5459

5560
#if defined(__WIN__)
@@ -61,7 +66,8 @@ C_MODE_START
6166
#define SD_BOTH 0x02
6267
*/
6368
#define SHUT_RDWR 0x02
64-
69+
#else
70+
#include <netdb.h> /* getaddrinfo() & co */
6571
#endif
6672

6773
/*

libmysql/libmysql.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
/* Copyright (C) 2000-2004 MySQL AB
1+
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
5-
the Free Software Foundation.
6-
7-
There are special exceptions to the terms and conditions of the GPL as it
8-
is applied to this software.
5+
the Free Software Foundation; version 2 of the License.
96
107
This program is distributed in the hope that it will be useful,
118
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -14,7 +11,7 @@
1411
1512
You should have received a copy of the GNU General Public License
1613
along with this program; if not, write to the Free Software
17-
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
14+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
1815

1916
#include <my_global.h>
2017
#include <my_sys.h>
@@ -34,10 +31,6 @@
3431
#include <pwd.h>
3532
#endif
3633
#if !defined(__WIN__)
37-
#include <sys/socket.h>
38-
#include <netinet/in.h>
39-
#include <arpa/inet.h>
40-
#include <netdb.h>
4134
#ifdef HAVE_SELECT_H
4235
#include <select.h>
4336
#endif

libmysqld/libmysqld.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (C) 2000 MySQL AB
1+
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
1111
1212
You should have received a copy of the GNU General Public License
1313
along with this program; if not, write to the Free Software
14-
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
14+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
1515

1616
#include <my_global.h>
1717
#include <mysql.h>
@@ -33,10 +33,6 @@
3333
#include <pwd.h>
3434
#endif
3535
#if !defined(__WIN__)
36-
#include <sys/socket.h>
37-
#include <netinet/in.h>
38-
#include <arpa/inet.h>
39-
#include <netdb.h>
4036
#ifdef HAVE_SELECT_H
4137
# include <select.h>
4238
#endif

sql-common/client.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@
3737

3838
#include "mysql.h"
3939

40-
#ifndef __WIN__
41-
#include <netdb.h>
42-
#endif
43-
4440
/* Remove client convenience wrappers */
4541
#undef max_allowed_packet
4642
#undef net_buffer_length
@@ -61,6 +57,7 @@ my_bool net_flush(NET *net);
6157
#else /*EMBEDDED_LIBRARY*/
6258
#define CLI_MYSQL_REAL_CONNECT STDCALL mysql_real_connect
6359
#endif /*EMBEDDED_LIBRARY*/
60+
6461
#include <my_sys.h>
6562
#include <mysys_err.h>
6663
#include <m_string.h>
@@ -69,28 +66,28 @@ my_bool net_flush(NET *net);
6966
#include "mysqld_error.h"
7067
#include "errmsg.h"
7168
#include <violite.h>
69+
7270
#if !defined(__WIN__)
7371
#include <my_pthread.h> /* because of signal() */
7472
#endif /* !defined(__WIN__) */
7573

7674
#include <sys/stat.h>
7775
#include <signal.h>
7876
#include <time.h>
77+
7978
#ifdef HAVE_PWD_H
8079
#include <pwd.h>
8180
#endif
81+
8282
#if !defined(__WIN__)
83-
#include <sys/socket.h>
84-
#include <netinet/in.h>
85-
#include <arpa/inet.h>
86-
#include <netdb.h>
8783
#ifdef HAVE_SELECT_H
8884
# include <select.h>
8985
#endif
9086
#ifdef HAVE_SYS_SELECT_H
91-
#include <sys/select.h>
87+
# include <sys/select.h>
9288
#endif
9389
#endif /* !defined(__WIN__) */
90+
9491
#ifdef HAVE_SYS_UN_H
9592
# include <sys/un.h>
9693
#endif
@@ -111,6 +108,7 @@ my_bool net_flush(NET *net);
111108
#include "client_settings.h"
112109
#include <sql_common.h>
113110
#include <mysql/client_plugin.h>
111+
114112
#define native_password_plugin_name "mysql_native_password"
115113
#define old_password_plugin_name "mysql_old_password"
116114

sql/hostname.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@
2626

2727
#include "sql_priv.h"
2828
#include "hostname.h"
29-
#include "my_global.h"
30-
#ifndef __WIN__
31-
#include <netdb.h> // getservbyname, servent
32-
#endif
3329
#include "hash_filo.h"
3430
#include <m_ctype.h>
3531
#include "log.h" // sql_print_warning,

sql/mysqld.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@
1717
#include "sql_priv.h"
1818
#include "unireg.h"
1919
#include <signal.h>
20-
#ifndef __WIN__
21-
#include <netdb.h> // getservbyname, servent
22-
#endif
2320
#include "sql_parse.h" // test_if_data_home_dir
2421
#include "sql_cache.h" // query_cache, query_cache_*
2522
#include "sql_locale.h" // MY_LOCALES, my_locales, my_locale_by_name

sql/sql_connect.cc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -20,9 +20,6 @@
2020

2121
#include "my_global.h"
2222
#include "sql_priv.h"
23-
#ifndef __WIN__
24-
#include <netdb.h> // getservbyname, servent
25-
#endif
2623
#include "sql_audit.h"
2724
#include "sql_connect.h"
2825
#include "my_global.h"

vio/vio_priv.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef VIO_PRIV_INCLUDED
22
#define VIO_PRIV_INCLUDED
33

4-
/* Copyright (C) 2003 MySQL AB
4+
/* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
55
66
This program is free software; you can redistribute it and/or modify
77
it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
1414
1515
You should have received a copy of the GNU General Public License
1616
along with this program; if not, write to the Free Software
17-
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
17+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
1818

1919
/* Structures and functions private to the vio package */
2020

@@ -25,11 +25,6 @@
2525
#include <m_string.h>
2626
#include <violite.h>
2727

28-
#ifndef __WIN__
29-
#include <sys/socket.h>
30-
#include <netdb.h>
31-
#endif
32-
3328
#ifdef _WIN32
3429
void vio_win32_timeout(Vio *vio, uint which, uint timeout);
3530
#endif

0 commit comments

Comments
 (0)