Merge lp:~brianaker/drizzle/autoconf-foo-update into lp:~drizzle-trunk/drizzle/development
- autoconf-foo-update
- Merge into development
Proposed by
Brian Aker
Status: | Merged |
---|---|
Approved by: | Brian Aker |
Approved revision: | 2498 |
Merged at revision: | 2499 |
Proposed branch: | lp:~brianaker/drizzle/autoconf-foo-update |
Merge into: | lp:~drizzle-trunk/drizzle/development |
Diff against target: |
605 lines (+205/-178) 10 files modified
bootstrap.sh (+0/-26) client/drizzle.cc (+20/-4) config/autorun.sh (+1/-1) drizzled/drizzled.cc (+1/-1) libdrizzle-1.0/structs.h (+2/-3) libdrizzle/conn.cc (+137/-93) libdrizzle/conn_uds.cc (+12/-14) libdrizzle/drizzle.cc (+1/-1) m4/pkg.m4 (+30/-33) win32/include.am (+1/-2) |
To merge this branch: | bzr merge lp:~brianaker/drizzle/autoconf-foo-update |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Drizzle Merge Team | Pending | ||
Review via email: mp+90599@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
- 2499. By Brian Aker
-
Fix NI_SERV
- 2500. By Brian Aker
-
Fix unix domain socket to not require that we keep the addr structure sitting around.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'bootstrap.sh' | |||
2 | --- bootstrap.sh 2011-12-14 20:53:40 +0000 | |||
3 | +++ bootstrap.sh 2012-01-30 06:09:24 +0000 | |||
4 | @@ -1,31 +1,5 @@ | |||
5 | 1 | #!/bin/bash | 1 | #!/bin/bash |
6 | 2 | 2 | ||
7 | 3 | # Copyright (C) 2011 Brian Aker | ||
8 | 4 | # All rights reserved. | ||
9 | 5 | # | ||
10 | 6 | # Redistribution and use in source and binary forms, with or without | ||
11 | 7 | # modification, are permitted provided that the following conditions are met: | ||
12 | 8 | # | ||
13 | 9 | # 1. Redistributions of source code must retain the above copyright | ||
14 | 10 | # notice, this list of conditions and the following disclaimer. | ||
15 | 11 | # 2. Redistributions in binary form must reproduce the above copyright | ||
16 | 12 | # notice, this list of conditions and the following disclaimer in the | ||
17 | 13 | # documentation and/or other materials provided with the distribution. | ||
18 | 14 | # 3. The name of the author may not be used to endorse or promote products | ||
19 | 15 | # derived from this software without specific prior written permission. | ||
20 | 16 | # | ||
21 | 17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
22 | 18 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
23 | 19 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
24 | 20 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR | ||
25 | 21 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||
26 | 22 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | ||
27 | 23 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | ||
28 | 24 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
29 | 25 | # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||
30 | 26 | # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
31 | 27 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
32 | 28 | |||
33 | 29 | if test -f configure; then make clean; make merge-clean; make distclean; fi; | 3 | if test -f configure; then make clean; make merge-clean; make distclean; fi; |
34 | 30 | 4 | ||
35 | 31 | rm -r -f autom4te.cache | 5 | rm -r -f autom4te.cache |
36 | 32 | 6 | ||
37 | === modified file 'client/drizzle.cc' | |||
38 | --- client/drizzle.cc 2011-11-26 23:14:59 +0000 | |||
39 | +++ client/drizzle.cc 2012-01-30 06:09:24 +0000 | |||
40 | @@ -324,6 +324,8 @@ | |||
41 | 324 | opt_password, | 324 | opt_password, |
42 | 325 | opt_protocol; | 325 | opt_protocol; |
43 | 326 | 326 | ||
44 | 327 | static std::string socket_file; | ||
45 | 328 | |||
46 | 327 | static const char* get_day_name(int day_of_week) | 329 | static const char* get_day_name(int day_of_week) |
47 | 328 | { | 330 | { |
48 | 329 | switch(day_of_week) | 331 | switch(day_of_week) |
49 | @@ -1476,6 +1478,8 @@ | |||
50 | 1476 | ("host,h", po::value<string>(¤t_host)->default_value("localhost"), | 1478 | ("host,h", po::value<string>(¤t_host)->default_value("localhost"), |
51 | 1477 | _("Connect to host")) | 1479 | _("Connect to host")) |
52 | 1478 | ("password,P", po::value<string>(¤t_password)->default_value(PASSWORD_SENTINEL), | 1480 | ("password,P", po::value<string>(¤t_password)->default_value(PASSWORD_SENTINEL), |
53 | 1481 | _("Socket file to use when connecting to server.")) | ||
54 | 1482 | ("socket", po::value<string>(&socket_file), | ||
55 | 1479 | _("Password to use when connecting to server. If password is not given it's asked from the tty.")) | 1483 | _("Password to use when connecting to server. If password is not given it's asked from the tty.")) |
56 | 1480 | ("port,p", po::value<uint32_t>()->default_value(0), | 1484 | ("port,p", po::value<uint32_t>()->default_value(0), |
57 | 1481 | _("Port number to use for connection or 0 for default to, in order of preference, drizzle.cnf, $DRIZZLE_TCP_PORT, built-in default")) | 1485 | _("Port number to use for connection or 0 for default to, in order of preference, drizzle.cnf, $DRIZZLE_TCP_PORT, built-in default")) |
58 | @@ -4199,10 +4203,22 @@ | |||
59 | 4199 | return 1; | 4203 | return 1; |
60 | 4200 | } | 4204 | } |
61 | 4201 | 4205 | ||
66 | 4202 | if ((con= drizzle_con_add_tcp(drizzle, host.c_str(), | 4206 | if (socket_file.size()) |
67 | 4203 | opt_drizzle_port, user.c_str(), | 4207 | { |
68 | 4204 | password.c_str(), database.c_str(), | 4208 | if ((con= drizzle_con_add_uds(drizzle, socket_file.c_str(), |
69 | 4205 | global_con_options)) == NULL) | 4209 | user.c_str(), password.c_str(), |
70 | 4210 | database.c_str(), | ||
71 | 4211 | global_con_options)) == NULL) | ||
72 | 4212 | { | ||
73 | 4213 | (void) put_error(con, NULL); | ||
74 | 4214 | (void) fflush(stdout); | ||
75 | 4215 | return 1; | ||
76 | 4216 | } | ||
77 | 4217 | } | ||
78 | 4218 | else if ((con= drizzle_con_add_tcp(drizzle, host.c_str(), | ||
79 | 4219 | opt_drizzle_port, user.c_str(), | ||
80 | 4220 | password.c_str(), database.c_str(), | ||
81 | 4221 | global_con_options)) == NULL) | ||
82 | 4206 | { | 4222 | { |
83 | 4207 | (void) put_error(con, NULL); | 4223 | (void) put_error(con, NULL); |
84 | 4208 | (void) fflush(stdout); | 4224 | (void) fflush(stdout); |
85 | 4209 | 4225 | ||
86 | === modified file 'config/autorun.sh' | |||
87 | --- config/autorun.sh 2011-08-09 05:28:47 +0000 | |||
88 | +++ config/autorun.sh 2012-01-30 06:09:24 +0000 | |||
89 | @@ -25,4 +25,4 @@ | |||
90 | 25 | # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 25 | # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
91 | 26 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
92 | 27 | 27 | ||
94 | 28 | autoreconf -ivf | 28 | autoreconf --install --force --verbose -Wall |
95 | 29 | 29 | ||
96 | === modified file 'drizzled/drizzled.cc' | |||
97 | --- drizzled/drizzled.cc 2012-01-06 18:52:56 +0000 | |||
98 | +++ drizzled/drizzled.cc 2012-01-30 06:09:24 +0000 | |||
99 | @@ -1366,7 +1366,7 @@ | |||
100 | 1366 | } | 1366 | } |
101 | 1367 | catch (po::unknown_option &err) | 1367 | catch (po::unknown_option &err) |
102 | 1368 | { | 1368 | { |
104 | 1369 | unireg_abort << "Use --help to get a list of available options. " << err.what(); | 1369 | unireg_abort << "Use --help to get a list of available options. " << err.what(); |
105 | 1370 | } | 1370 | } |
106 | 1371 | 1371 | ||
107 | 1372 | try | 1372 | try |
108 | 1373 | 1373 | ||
109 | === modified file 'libdrizzle-1.0/structs.h' | |||
110 | --- libdrizzle-1.0/structs.h 2011-12-28 23:32:47 +0000 | |||
111 | +++ libdrizzle-1.0/structs.h 2012-01-30 06:09:24 +0000 | |||
112 | @@ -94,7 +94,7 @@ | |||
113 | 94 | in_port_t port; | 94 | in_port_t port; |
114 | 95 | struct addrinfo *addrinfo; | 95 | struct addrinfo *addrinfo; |
115 | 96 | char *host; | 96 | char *host; |
117 | 97 | char host_buffer[NI_MAXHOST]; | 97 | char host_buffer[LIBDRIZZLE_NI_MAXHOST]; |
118 | 98 | }; | 98 | }; |
119 | 99 | 99 | ||
120 | 100 | /** | 100 | /** |
121 | @@ -102,8 +102,7 @@ | |||
122 | 102 | */ | 102 | */ |
123 | 103 | struct drizzle_con_uds_st | 103 | struct drizzle_con_uds_st |
124 | 104 | { | 104 | { |
127 | 105 | struct addrinfo addrinfo; | 105 | char path_buffer[LIBDRIZZLE_NI_MAXHOST]; |
126 | 106 | struct sockaddr_un sockaddr; | ||
128 | 107 | }; | 106 | }; |
129 | 108 | 107 | ||
130 | 109 | /** | 108 | /** |
131 | 110 | 109 | ||
132 | === modified file 'libdrizzle/conn.cc' | |||
133 | --- libdrizzle/conn.cc 2012-01-05 06:31:25 +0000 | |||
134 | +++ libdrizzle/conn.cc 2012-01-30 06:09:24 +0000 | |||
135 | @@ -1062,7 +1062,7 @@ | |||
136 | 1062 | break; | 1062 | break; |
137 | 1063 | 1063 | ||
138 | 1064 | case DRIZZLE_CON_SOCKET_UDS: | 1064 | case DRIZZLE_CON_SOCKET_UDS: |
140 | 1065 | con->socket.uds.addrinfo.ai_addr= NULL; | 1065 | con->socket.uds.path_buffer[0]= 0; |
141 | 1066 | break; | 1066 | break; |
142 | 1067 | 1067 | ||
143 | 1068 | default: | 1068 | default: |
144 | @@ -1150,7 +1150,6 @@ | |||
145 | 1150 | break; | 1150 | break; |
146 | 1151 | 1151 | ||
147 | 1152 | case DRIZZLE_CON_SOCKET_UDS: | 1152 | case DRIZZLE_CON_SOCKET_UDS: |
148 | 1153 | con->addrinfo_next= &(con->socket.uds.addrinfo); | ||
149 | 1154 | break; | 1153 | break; |
150 | 1155 | 1154 | ||
151 | 1156 | default: | 1155 | default: |
152 | @@ -1179,102 +1178,147 @@ | |||
153 | 1179 | con->fd= -1; | 1178 | con->fd= -1; |
154 | 1180 | } | 1179 | } |
155 | 1181 | 1180 | ||
184 | 1182 | if (con->addrinfo_next == NULL) | 1181 | if (con->socket_type == DRIZZLE_CON_SOCKET_UDS) |
185 | 1183 | { | 1182 | { |
186 | 1184 | drizzle_set_error(con->drizzle, __func__, "could not connect"); | 1183 | #ifndef WIN32 |
187 | 1185 | drizzle_state_reset(con); | 1184 | if ((con->fd= socket(AF_UNIX, SOCK_STREAM, 0)) < 0) |
188 | 1186 | return DRIZZLE_RETURN_COULD_NOT_CONNECT; | 1185 | { |
189 | 1187 | } | 1186 | con->drizzle->last_errno= errno; |
190 | 1188 | 1187 | return DRIZZLE_RETURN_COULD_NOT_CONNECT; | |
191 | 1189 | con->fd= socket(con->addrinfo_next->ai_family, | 1188 | } |
192 | 1190 | con->addrinfo_next->ai_socktype, | 1189 | |
193 | 1191 | con->addrinfo_next->ai_protocol); | 1190 | struct sockaddr_un servAddr; |
194 | 1192 | if (con->fd == -1) | 1191 | |
195 | 1193 | { | 1192 | memset(&servAddr, 0, sizeof (struct sockaddr_un)); |
196 | 1194 | drizzle_set_error(con->drizzle, __func__, "socket:%s", strerror(errno)); | 1193 | servAddr.sun_family= AF_UNIX; |
197 | 1195 | con->drizzle->last_errno= errno; | 1194 | strncpy(servAddr.sun_path, con->socket.uds.path_buffer, sizeof(servAddr.sun_path)); /* Copy filename */ |
198 | 1196 | return DRIZZLE_RETURN_COULD_NOT_CONNECT; | 1195 | |
199 | 1197 | } | 1196 | do { |
200 | 1198 | 1197 | if (connect(con->fd, (struct sockaddr *)&servAddr, sizeof(servAddr)) < 0) | |
201 | 1199 | dret= _con_setsockopt(con); | 1198 | { |
202 | 1200 | if (dret != DRIZZLE_RETURN_OK) | 1199 | switch (errno) |
203 | 1201 | { | 1200 | { |
204 | 1202 | con->drizzle->last_errno= errno; | 1201 | case EINPROGRESS: |
205 | 1203 | return DRIZZLE_RETURN_COULD_NOT_CONNECT; | 1202 | case EALREADY: |
206 | 1204 | } | 1203 | case EINTR: |
207 | 1205 | 1204 | continue; | |
208 | 1206 | while (1) | 1205 | |
209 | 1207 | { | 1206 | case EISCONN: /* We were spinning waiting on connect */ |
210 | 1208 | ret= connect(con->fd, con->addrinfo_next->ai_addr, | 1207 | { |
211 | 1209 | con->addrinfo_next->ai_addrlen); | 1208 | break; |
212 | 1209 | } | ||
213 | 1210 | |||
214 | 1211 | default: | ||
215 | 1212 | con->drizzle->last_errno= errno; | ||
216 | 1213 | return DRIZZLE_RETURN_COULD_NOT_CONNECT; | ||
217 | 1214 | } | ||
218 | 1215 | } | ||
219 | 1216 | } while (0); | ||
220 | 1217 | |||
221 | 1218 | return DRIZZLE_RETURN_OK; | ||
222 | 1219 | #else | ||
223 | 1220 | return DRIZZLE_RETURN_COULD_NOT_CONNECT; | ||
224 | 1221 | #endif | ||
225 | 1222 | } | ||
226 | 1223 | else | ||
227 | 1224 | { | ||
228 | 1225 | if (con->addrinfo_next == NULL) | ||
229 | 1226 | { | ||
230 | 1227 | drizzle_set_error(con->drizzle, __func__, "could not connect"); | ||
231 | 1228 | drizzle_state_reset(con); | ||
232 | 1229 | return DRIZZLE_RETURN_COULD_NOT_CONNECT; | ||
233 | 1230 | } | ||
234 | 1231 | |||
235 | 1232 | con->fd= socket(con->addrinfo_next->ai_family, | ||
236 | 1233 | con->addrinfo_next->ai_socktype, | ||
237 | 1234 | con->addrinfo_next->ai_protocol); | ||
238 | 1235 | if (con->fd == -1) | ||
239 | 1236 | { | ||
240 | 1237 | drizzle_set_error(con->drizzle, __func__, "socket:%s", strerror(errno)); | ||
241 | 1238 | con->drizzle->last_errno= errno; | ||
242 | 1239 | return DRIZZLE_RETURN_COULD_NOT_CONNECT; | ||
243 | 1240 | } | ||
244 | 1241 | |||
245 | 1242 | dret= _con_setsockopt(con); | ||
246 | 1243 | if (dret != DRIZZLE_RETURN_OK) | ||
247 | 1244 | { | ||
248 | 1245 | con->drizzle->last_errno= errno; | ||
249 | 1246 | return DRIZZLE_RETURN_COULD_NOT_CONNECT; | ||
250 | 1247 | } | ||
251 | 1248 | |||
252 | 1249 | while (1) | ||
253 | 1250 | { | ||
254 | 1251 | ret= connect(con->fd, con->addrinfo_next->ai_addr, | ||
255 | 1252 | con->addrinfo_next->ai_addrlen); | ||
256 | 1210 | 1253 | ||
257 | 1211 | #ifdef _WIN32 | 1254 | #ifdef _WIN32 |
289 | 1212 | errno = WSAGetLastError(); | 1255 | errno = WSAGetLastError(); |
290 | 1213 | switch(errno) { | 1256 | switch(errno) { |
291 | 1214 | case WSAEINVAL: | 1257 | case WSAEINVAL: |
292 | 1215 | case WSAEALREADY: | 1258 | case WSAEALREADY: |
293 | 1216 | case WSAEWOULDBLOCK: | 1259 | case WSAEWOULDBLOCK: |
294 | 1217 | errno= EINPROGRESS; | 1260 | errno= EINPROGRESS; |
295 | 1218 | break; | 1261 | break; |
296 | 1219 | case WSAECONNREFUSED: | 1262 | case WSAECONNREFUSED: |
297 | 1220 | errno= ECONNREFUSED; | 1263 | errno= ECONNREFUSED; |
298 | 1221 | break; | 1264 | break; |
299 | 1222 | case WSAENETUNREACH: | 1265 | case WSAENETUNREACH: |
300 | 1223 | errno= ENETUNREACH; | 1266 | errno= ENETUNREACH; |
301 | 1224 | break; | 1267 | break; |
302 | 1225 | case WSAETIMEDOUT: | 1268 | case WSAETIMEDOUT: |
303 | 1226 | errno= ETIMEDOUT; | 1269 | errno= ETIMEDOUT; |
304 | 1227 | break; | 1270 | break; |
305 | 1228 | case WSAECONNRESET: | 1271 | case WSAECONNRESET: |
306 | 1229 | errno= ECONNRESET; | 1272 | errno= ECONNRESET; |
307 | 1230 | break; | 1273 | break; |
308 | 1231 | case WSAEADDRINUSE: | 1274 | case WSAEADDRINUSE: |
309 | 1232 | errno= EADDRINUSE; | 1275 | errno= EADDRINUSE; |
310 | 1233 | break; | 1276 | break; |
311 | 1234 | case WSAEOPNOTSUPP: | 1277 | case WSAEOPNOTSUPP: |
312 | 1235 | errno= EOPNOTSUPP; | 1278 | errno= EOPNOTSUPP; |
313 | 1236 | break; | 1279 | break; |
314 | 1237 | case WSAENOPROTOOPT: | 1280 | case WSAENOPROTOOPT: |
315 | 1238 | errno= ENOPROTOOPT; | 1281 | errno= ENOPROTOOPT; |
316 | 1239 | break; | 1282 | break; |
317 | 1240 | default: | 1283 | default: |
318 | 1241 | break; | 1284 | break; |
319 | 1242 | } | 1285 | } |
320 | 1243 | #endif /* _WIN32 */ | 1286 | #endif /* _WIN32 */ |
351 | 1244 | 1287 | ||
352 | 1245 | drizzle_log_crazy(con->drizzle, "connect return=%d errno=%s", ret, strerror(errno)); | 1288 | drizzle_log_crazy(con->drizzle, "connect return=%d errno=%s", ret, strerror(errno)); |
353 | 1246 | 1289 | ||
354 | 1247 | if (ret == 0) | 1290 | if (ret == 0) |
355 | 1248 | { | 1291 | { |
356 | 1249 | con->addrinfo_next= NULL; | 1292 | con->addrinfo_next= NULL; |
357 | 1250 | break; | 1293 | break; |
358 | 1251 | } | 1294 | } |
359 | 1252 | 1295 | ||
360 | 1253 | if (errno == EAGAIN || errno == EINTR) | 1296 | if (errno == EAGAIN || errno == EINTR) |
361 | 1254 | { | 1297 | { |
362 | 1255 | continue; | 1298 | continue; |
363 | 1256 | } | 1299 | } |
364 | 1257 | 1300 | ||
365 | 1258 | if (errno == EINPROGRESS) | 1301 | if (errno == EINPROGRESS) |
366 | 1259 | { | 1302 | { |
367 | 1260 | drizzle_state_pop(con); | 1303 | drizzle_state_pop(con); |
368 | 1261 | drizzle_state_push(con, drizzle_state_connecting); | 1304 | drizzle_state_push(con, drizzle_state_connecting); |
369 | 1262 | return DRIZZLE_RETURN_OK; | 1305 | return DRIZZLE_RETURN_OK; |
370 | 1263 | } | 1306 | } |
371 | 1264 | 1307 | ||
372 | 1265 | if (errno == ECONNREFUSED || errno == ENETUNREACH || errno == ETIMEDOUT) | 1308 | if (errno == ECONNREFUSED || errno == ENETUNREACH || errno == ETIMEDOUT) |
373 | 1266 | { | 1309 | { |
374 | 1267 | con->addrinfo_next= con->addrinfo_next->ai_next; | 1310 | con->addrinfo_next= con->addrinfo_next->ai_next; |
375 | 1268 | return DRIZZLE_RETURN_OK; | 1311 | return DRIZZLE_RETURN_OK; |
376 | 1269 | } | 1312 | } |
377 | 1270 | 1313 | ||
378 | 1271 | drizzle_set_error(con->drizzle, __func__, "connect:%s", strerror(errno)); | 1314 | drizzle_set_error(con->drizzle, __func__, "connect:%s", strerror(errno)); |
379 | 1272 | con->drizzle->last_errno= errno; | 1315 | con->drizzle->last_errno= errno; |
380 | 1273 | return DRIZZLE_RETURN_COULD_NOT_CONNECT; | 1316 | return DRIZZLE_RETURN_COULD_NOT_CONNECT; |
381 | 1317 | } | ||
382 | 1318 | |||
383 | 1319 | drizzle_state_pop(con); | ||
384 | 1274 | } | 1320 | } |
385 | 1275 | 1321 | ||
386 | 1276 | drizzle_state_pop(con); | ||
387 | 1277 | |||
388 | 1278 | return DRIZZLE_RETURN_OK; | 1322 | return DRIZZLE_RETURN_OK; |
389 | 1279 | } | 1323 | } |
390 | 1280 | 1324 | ||
391 | 1281 | 1325 | ||
392 | === modified file 'libdrizzle/conn_uds.cc' | |||
393 | --- libdrizzle/conn_uds.cc 2011-12-28 21:59:11 +0000 | |||
394 | +++ libdrizzle/conn_uds.cc 2012-01-30 06:09:24 +0000 | |||
395 | @@ -51,11 +51,15 @@ | |||
396 | 51 | 51 | ||
397 | 52 | if (con->socket_type == DRIZZLE_CON_SOCKET_UDS) | 52 | if (con->socket_type == DRIZZLE_CON_SOCKET_UDS) |
398 | 53 | { | 53 | { |
401 | 54 | if (con->socket.uds.sockaddr.sun_path[0] != 0) | 54 | if (con->socket.uds.path_buffer[0] != 0) |
402 | 55 | return con->socket.uds.sockaddr.sun_path; | 55 | { |
403 | 56 | return con->socket.uds.path_buffer; | ||
404 | 57 | } | ||
405 | 56 | 58 | ||
406 | 57 | if (con->options & DRIZZLE_CON_MYSQL) | 59 | if (con->options & DRIZZLE_CON_MYSQL) |
407 | 60 | { | ||
408 | 58 | return DRIZZLE_DEFAULT_UDS_MYSQL; | 61 | return DRIZZLE_DEFAULT_UDS_MYSQL; |
409 | 62 | } | ||
410 | 59 | 63 | ||
411 | 60 | return DRIZZLE_DEFAULT_UDS; | 64 | return DRIZZLE_DEFAULT_UDS; |
412 | 61 | } | 65 | } |
413 | @@ -77,16 +81,10 @@ | |||
414 | 77 | if (uds == NULL) | 81 | if (uds == NULL) |
415 | 78 | { | 82 | { |
416 | 79 | uds= ""; | 83 | uds= ""; |
429 | 80 | } | 84 | con->socket.uds.path_buffer[0]= 0; |
430 | 81 | 85 | } | |
431 | 82 | con->socket.uds.sockaddr.sun_family= AF_UNIX; | 86 | else |
432 | 83 | strncpy(con->socket.uds.sockaddr.sun_path, uds, | 87 | { |
433 | 84 | sizeof(con->socket.uds.sockaddr.sun_path)); | 88 | strncpy(con->socket.uds.path_buffer, uds, sizeof(con->socket.uds.path_buffer)); |
434 | 85 | con->socket.uds.sockaddr.sun_path[sizeof(con->socket.uds.sockaddr.sun_path) - 1]= 0; | 89 | } |
423 | 86 | |||
424 | 87 | con->socket.uds.addrinfo.ai_family= AF_UNIX; | ||
425 | 88 | con->socket.uds.addrinfo.ai_socktype= SOCK_STREAM; | ||
426 | 89 | con->socket.uds.addrinfo.ai_protocol= 0; | ||
427 | 90 | con->socket.uds.addrinfo.ai_addrlen= sizeof(struct sockaddr_un); | ||
428 | 91 | con->socket.uds.addrinfo.ai_addr= (struct sockaddr *)&(con->socket.uds.sockaddr); | ||
435 | 92 | } | 90 | } |
436 | 93 | 91 | ||
437 | === modified file 'libdrizzle/drizzle.cc' | |||
438 | --- libdrizzle/drizzle.cc 2012-01-05 06:31:25 +0000 | |||
439 | +++ libdrizzle/drizzle.cc 2012-01-30 06:09:24 +0000 | |||
440 | @@ -492,7 +492,7 @@ | |||
441 | 492 | break; | 492 | break; |
442 | 493 | 493 | ||
443 | 494 | case DRIZZLE_CON_SOCKET_UDS: | 494 | case DRIZZLE_CON_SOCKET_UDS: |
445 | 495 | drizzle_con_set_uds(con, from->socket.uds.sockaddr.sun_path); | 495 | drizzle_con_set_uds(con, from->socket.uds.path_buffer); |
446 | 496 | break; | 496 | break; |
447 | 497 | 497 | ||
448 | 498 | default: | 498 | default: |
449 | 499 | 499 | ||
450 | === modified file 'm4/pkg.m4' | |||
451 | --- m4/pkg.m4 2010-11-17 22:14:45 +0000 | |||
452 | +++ m4/pkg.m4 2012-01-30 06:09:24 +0000 | |||
453 | @@ -1,4 +1,5 @@ | |||
454 | 1 | # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- | 1 | # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- |
455 | 2 | # serial 1 (pkg-config-0.24) | ||
456 | 2 | # | 3 | # |
457 | 3 | # Copyright © 2004 Scott James Remnant <scott@netsplit.com>. | 4 | # Copyright © 2004 Scott James Remnant <scott@netsplit.com>. |
458 | 4 | # | 5 | # |
459 | @@ -14,7 +15,7 @@ | |||
460 | 14 | # | 15 | # |
461 | 15 | # You should have received a copy of the GNU General Public License | 16 | # You should have received a copy of the GNU General Public License |
462 | 16 | # along with this program; if not, write to the Free Software | 17 | # along with this program; if not, write to the Free Software |
464 | 17 | # Foundation, Inc., 51 Franklin Place - Suite 330, Boston, MA 02110-1301, USA. | 18 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
465 | 18 | # | 19 | # |
466 | 19 | # As a special exception to the GNU General Public License, if you | 20 | # As a special exception to the GNU General Public License, if you |
467 | 20 | # distribute this file as part of a program that contains a | 21 | # distribute this file as part of a program that contains a |
468 | @@ -26,7 +27,10 @@ | |||
469 | 26 | AC_DEFUN([PKG_PROG_PKG_CONFIG], | 27 | AC_DEFUN([PKG_PROG_PKG_CONFIG], |
470 | 27 | [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) | 28 | [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) |
471 | 28 | m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) | 29 | m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) |
473 | 29 | AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl | 30 | AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) |
474 | 31 | AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) | ||
475 | 32 | AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) | ||
476 | 33 | |||
477 | 30 | if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then | 34 | if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then |
478 | 31 | AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) | 35 | AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) |
479 | 32 | fi | 36 | fi |
480 | @@ -39,7 +43,6 @@ | |||
481 | 39 | AC_MSG_RESULT([no]) | 43 | AC_MSG_RESULT([no]) |
482 | 40 | PKG_CONFIG="" | 44 | PKG_CONFIG="" |
483 | 41 | fi | 45 | fi |
484 | 42 | |||
485 | 43 | fi[]dnl | 46 | fi[]dnl |
486 | 44 | ])# PKG_PROG_PKG_CONFIG | 47 | ])# PKG_PROG_PKG_CONFIG |
487 | 45 | 48 | ||
488 | @@ -48,37 +51,31 @@ | |||
489 | 48 | # Check to see whether a particular set of modules exists. Similar | 51 | # Check to see whether a particular set of modules exists. Similar |
490 | 49 | # to PKG_CHECK_MODULES(), but does not set variables or print errors. | 52 | # to PKG_CHECK_MODULES(), but does not set variables or print errors. |
491 | 50 | # | 53 | # |
496 | 51 | # | 54 | # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) |
497 | 52 | # Similar to PKG_CHECK_MODULES, make sure that the first instance of | 55 | # only at the first occurence in configure.ac, so if the first place |
498 | 53 | # this or PKG_CHECK_MODULES is called, or make sure to call | 56 | # it's called might be skipped (such as if it is within an "if", you |
499 | 54 | # PKG_CHECK_EXISTS manually | 57 | # have to call PKG_CHECK_EXISTS manually |
500 | 55 | # -------------------------------------------------------------- | 58 | # -------------------------------------------------------------- |
501 | 56 | AC_DEFUN([PKG_CHECK_EXISTS], | 59 | AC_DEFUN([PKG_CHECK_EXISTS], |
502 | 57 | [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl | 60 | [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl |
503 | 58 | if test -n "$PKG_CONFIG" && \ | 61 | if test -n "$PKG_CONFIG" && \ |
504 | 59 | AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then | 62 | AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then |
506 | 60 | m4_ifval([$2], [$2], [:]) | 63 | m4_default([$2], [:]) |
507 | 61 | m4_ifvaln([$3], [else | 64 | m4_ifvaln([$3], [else |
508 | 62 | $3])dnl | 65 | $3])dnl |
509 | 63 | fi]) | 66 | fi]) |
510 | 64 | 67 | ||
511 | 65 | |||
512 | 66 | # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) | 68 | # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) |
513 | 67 | # --------------------------------------------- | 69 | # --------------------------------------------- |
514 | 68 | m4_define([_PKG_CONFIG], | 70 | m4_define([_PKG_CONFIG], |
528 | 69 | [if test -n "$PKG_CONFIG"; then | 71 | [if test -n "$$1"; then |
529 | 70 | if test -n "$$1"; then | 72 | pkg_cv_[]$1="$$1" |
530 | 71 | pkg_cv_[]$1="$$1" | 73 | elif test -n "$PKG_CONFIG"; then |
531 | 72 | else | 74 | PKG_CHECK_EXISTS([$3], |
532 | 73 | PKG_CHECK_EXISTS([$3], | 75 | [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], |
533 | 74 | [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null | sed 's/-I/-isystem/g' `], | 76 | [pkg_failed=yes]) |
534 | 75 | [pkg_failed=yes]) | 77 | else |
535 | 76 | if test "$GCC" = "yes"; then | 78 | pkg_failed=untried |
523 | 77 | pkg_cv_[]$1=`echo $pkg_cv_[]$1 | sed 's/-I/-isystem/g' ` | ||
524 | 78 | fi | ||
525 | 79 | fi | ||
526 | 80 | else | ||
527 | 81 | pkg_failed=untried | ||
536 | 82 | fi[]dnl | 79 | fi[]dnl |
537 | 83 | ])# _PKG_CONFIG | 80 | ])# _PKG_CONFIG |
538 | 84 | 81 | ||
539 | @@ -120,16 +117,17 @@ | |||
540 | 120 | See the pkg-config man page for more details.]) | 117 | See the pkg-config man page for more details.]) |
541 | 121 | 118 | ||
542 | 122 | if test $pkg_failed = yes; then | 119 | if test $pkg_failed = yes; then |
543 | 120 | AC_MSG_RESULT([no]) | ||
544 | 123 | _PKG_SHORT_ERRORS_SUPPORTED | 121 | _PKG_SHORT_ERRORS_SUPPORTED |
545 | 124 | if test $_pkg_short_errors_supported = yes; then | 122 | if test $_pkg_short_errors_supported = yes; then |
547 | 125 | $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` | 123 | $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` |
548 | 126 | else | 124 | else |
550 | 127 | $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` | 125 | $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` |
551 | 128 | fi | 126 | fi |
552 | 129 | # Put the nasty error message in config.log where it belongs | 127 | # Put the nasty error message in config.log where it belongs |
553 | 130 | echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD | 128 | echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD |
554 | 131 | 129 | ||
556 | 132 | ifelse([$4], , [AC_MSG_ERROR(dnl | 130 | m4_default([$4], [AC_MSG_ERROR( |
557 | 133 | [Package requirements ($2) were not met: | 131 | [Package requirements ($2) were not met: |
558 | 134 | 132 | ||
559 | 135 | $$1_PKG_ERRORS | 133 | $$1_PKG_ERRORS |
560 | @@ -137,24 +135,23 @@ | |||
561 | 137 | Consider adjusting the PKG_CONFIG_PATH environment variable if you | 135 | Consider adjusting the PKG_CONFIG_PATH environment variable if you |
562 | 138 | installed software in a non-standard prefix. | 136 | installed software in a non-standard prefix. |
563 | 139 | 137 | ||
568 | 140 | _PKG_TEXT | 138 | _PKG_TEXT]) |
569 | 141 | ])], | 139 | ]) |
566 | 142 | [AC_MSG_RESULT([no]) | ||
567 | 143 | $4]) | ||
570 | 144 | elif test $pkg_failed = untried; then | 140 | elif test $pkg_failed = untried; then |
572 | 145 | ifelse([$4], , [AC_MSG_FAILURE(dnl | 141 | AC_MSG_RESULT([no]) |
573 | 142 | m4_default([$4], [AC_MSG_FAILURE( | ||
574 | 146 | [The pkg-config script could not be found or is too old. Make sure it | 143 | [The pkg-config script could not be found or is too old. Make sure it |
575 | 147 | is in your PATH or set the PKG_CONFIG environment variable to the full | 144 | is in your PATH or set the PKG_CONFIG environment variable to the full |
576 | 148 | path to pkg-config. | 145 | path to pkg-config. |
577 | 149 | 146 | ||
578 | 150 | _PKG_TEXT | 147 | _PKG_TEXT |
579 | 151 | 148 | ||
582 | 152 | To get pkg-config, see <http://pkg-config.freedesktop.org/>.])], | 149 | To get pkg-config, see <http://pkg-config.freedesktop.org/>.]) |
583 | 153 | [$4]) | 150 | ]) |
584 | 154 | else | 151 | else |
585 | 155 | $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS | 152 | $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS |
586 | 156 | $1[]_LIBS=$pkg_cv_[]$1[]_LIBS | 153 | $1[]_LIBS=$pkg_cv_[]$1[]_LIBS |
587 | 157 | AC_MSG_RESULT([yes]) | 154 | AC_MSG_RESULT([yes]) |
589 | 158 | ifelse([$3], , :, [$3]) | 155 | $3 |
590 | 159 | fi[]dnl | 156 | fi[]dnl |
591 | 160 | ])# PKG_CHECK_MODULES | 157 | ])# PKG_CHECK_MODULES |
592 | 161 | 158 | ||
593 | === modified file 'win32/include.am' | |||
594 | --- win32/include.am 2011-11-04 21:06:16 +0000 | |||
595 | +++ win32/include.am 2012-01-30 06:09:24 +0000 | |||
596 | @@ -19,8 +19,7 @@ | |||
597 | 19 | 19 | ||
598 | 20 | 20 | ||
599 | 21 | if BUILD_WIN32 | 21 | if BUILD_WIN32 |
602 | 22 | libdrizzle_2_0_libdrizzle_2_0_la_SOURCES+= win32/conn_uds.cc | 22 | libdrizzle_1_0_libdrizzle_la_SOURCES+= win32/conn_uds.cc |
601 | 23 | libdrizzle_1_0_libdrizzle_la_SOURCES+= win32/conn_uds.c | ||
603 | 24 | endif | 23 | endif |
604 | 25 | 24 | ||
605 | 26 | noinst_HEADERS+= \ | 25 | noinst_HEADERS+= \ |