Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
c4177ec4
Commit
c4177ec4
authored
Sep 15, 2006
by
msvensson@shellback.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use the enum/define SHUT_RDWR instead of heardcoded "2" to shutdown
parent
cb08c534
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
sql/mysqld.cc
sql/mysqld.cc
+8
-8
vio/viosocket.c
vio/viosocket.c
+1
-1
No files found.
sql/mysqld.cc
View file @
c4177ec4
...
@@ -713,7 +713,7 @@ static void close_connections(void)
...
@@ -713,7 +713,7 @@ static void close_connections(void)
{
{
if
(
ip_sock
!=
INVALID_SOCKET
)
if
(
ip_sock
!=
INVALID_SOCKET
)
{
{
(
void
)
shutdown
(
ip_sock
,
2
);
(
void
)
shutdown
(
ip_sock
,
SHUT_RDWR
);
(
void
)
closesocket
(
ip_sock
);
(
void
)
closesocket
(
ip_sock
);
ip_sock
=
INVALID_SOCKET
;
ip_sock
=
INVALID_SOCKET
;
}
}
...
@@ -745,7 +745,7 @@ static void close_connections(void)
...
@@ -745,7 +745,7 @@ static void close_connections(void)
#ifdef HAVE_SYS_UN_H
#ifdef HAVE_SYS_UN_H
if
(
unix_sock
!=
INVALID_SOCKET
)
if
(
unix_sock
!=
INVALID_SOCKET
)
{
{
(
void
)
shutdown
(
unix_sock
,
2
);
(
void
)
shutdown
(
unix_sock
,
SHUT_RDWR
);
(
void
)
closesocket
(
unix_sock
);
(
void
)
closesocket
(
unix_sock
);
(
void
)
unlink
(
mysqld_unix_port
);
(
void
)
unlink
(
mysqld_unix_port
);
unix_sock
=
INVALID_SOCKET
;
unix_sock
=
INVALID_SOCKET
;
...
@@ -848,7 +848,7 @@ static void close_server_sock()
...
@@ -848,7 +848,7 @@ static void close_server_sock()
{
{
ip_sock
=
INVALID_SOCKET
;
ip_sock
=
INVALID_SOCKET
;
DBUG_PRINT
(
"info"
,(
"calling shutdown on TCP/IP socket"
));
DBUG_PRINT
(
"info"
,(
"calling shutdown on TCP/IP socket"
));
VOID
(
shutdown
(
tmp_sock
,
2
));
VOID
(
shutdown
(
tmp_sock
,
SHUT_RDWR
));
#if defined(__NETWARE__)
#if defined(__NETWARE__)
/*
/*
The following code is disabled for normal systems as it causes MySQL
The following code is disabled for normal systems as it causes MySQL
...
@@ -863,7 +863,7 @@ static void close_server_sock()
...
@@ -863,7 +863,7 @@ static void close_server_sock()
{
{
unix_sock
=
INVALID_SOCKET
;
unix_sock
=
INVALID_SOCKET
;
DBUG_PRINT
(
"info"
,(
"calling shutdown on unix socket"
));
DBUG_PRINT
(
"info"
,(
"calling shutdown on unix socket"
));
VOID
(
shutdown
(
tmp_sock
,
2
));
VOID
(
shutdown
(
tmp_sock
,
SHUT_RDWR
));
#if defined(__NETWARE__)
#if defined(__NETWARE__)
/*
/*
The following code is disabled for normal systems as it may cause MySQL
The following code is disabled for normal systems as it may cause MySQL
...
@@ -4088,7 +4088,7 @@ pthread_handler_t handle_connections_sockets(void *arg __attribute__((unused)))
...
@@ -4088,7 +4088,7 @@ pthread_handler_t handle_connections_sockets(void *arg __attribute__((unused)))
if
(
req
.
sink
)
if
(
req
.
sink
)
((
void
(
*
)(
int
))
req
.
sink
)(
req
.
fd
);
((
void
(
*
)(
int
))
req
.
sink
)(
req
.
fd
);
(
void
)
shutdown
(
new_sock
,
2
);
(
void
)
shutdown
(
new_sock
,
SHUT_RDWR
);
(
void
)
closesocket
(
new_sock
);
(
void
)
closesocket
(
new_sock
);
continue
;
continue
;
}
}
...
@@ -4103,7 +4103,7 @@ pthread_handler_t handle_connections_sockets(void *arg __attribute__((unused)))
...
@@ -4103,7 +4103,7 @@ pthread_handler_t handle_connections_sockets(void *arg __attribute__((unused)))
if
(
getsockname
(
new_sock
,
&
dummy
,
&
dummyLen
)
<
0
)
if
(
getsockname
(
new_sock
,
&
dummy
,
&
dummyLen
)
<
0
)
{
{
sql_perror
(
"Error on new connection socket"
);
sql_perror
(
"Error on new connection socket"
);
(
void
)
shutdown
(
new_sock
,
2
);
(
void
)
shutdown
(
new_sock
,
SHUT_RDWR
);
(
void
)
closesocket
(
new_sock
);
(
void
)
closesocket
(
new_sock
);
continue
;
continue
;
}
}
...
@@ -4115,7 +4115,7 @@ pthread_handler_t handle_connections_sockets(void *arg __attribute__((unused)))
...
@@ -4115,7 +4115,7 @@ pthread_handler_t handle_connections_sockets(void *arg __attribute__((unused)))
if
(
!
(
thd
=
new
THD
))
if
(
!
(
thd
=
new
THD
))
{
{
(
void
)
shutdown
(
new_sock
,
2
);
(
void
)
shutdown
(
new_sock
,
SHUT_RDWR
);
VOID
(
closesocket
(
new_sock
));
VOID
(
closesocket
(
new_sock
));
continue
;
continue
;
}
}
...
@@ -4129,7 +4129,7 @@ pthread_handler_t handle_connections_sockets(void *arg __attribute__((unused)))
...
@@ -4129,7 +4129,7 @@ pthread_handler_t handle_connections_sockets(void *arg __attribute__((unused)))
vio_delete
(
vio_tmp
);
vio_delete
(
vio_tmp
);
else
else
{
{
(
void
)
shutdown
(
new_sock
,
2
);
(
void
)
shutdown
(
new_sock
,
SHUT_RDWR
);
(
void
)
closesocket
(
new_sock
);
(
void
)
closesocket
(
new_sock
);
}
}
delete
thd
;
delete
thd
;
...
...
vio/viosocket.c
View file @
c4177ec4
...
@@ -276,7 +276,7 @@ int vio_close(Vio * vio)
...
@@ -276,7 +276,7 @@ int vio_close(Vio * vio)
if
(
vio
->
type
!=
VIO_CLOSED
)
if
(
vio
->
type
!=
VIO_CLOSED
)
{
{
DBUG_ASSERT
(
vio
->
sd
>=
0
);
DBUG_ASSERT
(
vio
->
sd
>=
0
);
if
(
shutdown
(
vio
->
sd
,
2
))
if
(
shutdown
(
vio
->
sd
,
SHUT_RDWR
))
r
=
-
1
;
r
=
-
1
;
if
(
closesocket
(
vio
->
sd
))
if
(
closesocket
(
vio
->
sd
))
r
=
-
1
;
r
=
-
1
;
...
...
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