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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
e29bd611
Commit
e29bd611
authored
Apr 17, 2002
by
monty@tik.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Abort if 'listen()' on TCP/IP fails.
parent
7258bf93
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
sql/mysqld.cc
sql/mysqld.cc
+7
-6
No files found.
sql/mysqld.cc
View file @
e29bd611
...
@@ -917,21 +917,22 @@ static void server_init(void)
...
@@ -917,21 +917,22 @@ static void server_init(void)
IPaddr
.
sin_addr
.
s_addr
=
my_bind_addr
;
IPaddr
.
sin_addr
.
s_addr
=
my_bind_addr
;
IPaddr
.
sin_port
=
(
unsigned
short
)
htons
((
unsigned
short
)
mysql_port
);
IPaddr
.
sin_port
=
(
unsigned
short
)
htons
((
unsigned
short
)
mysql_port
);
(
void
)
setsockopt
(
ip_sock
,
SOL_SOCKET
,
SO_REUSEADDR
,(
char
*
)
&
arg
,
sizeof
(
arg
));
(
void
)
setsockopt
(
ip_sock
,
SOL_SOCKET
,
SO_REUSEADDR
,(
char
*
)
&
arg
,
sizeof
(
arg
));
for
(;;)
{
if
(
bind
(
ip_sock
,
my_reinterpret_cast
(
struct
sockaddr
*
)
(
&
IPaddr
),
if
(
bind
(
ip_sock
,
my_reinterpret_cast
(
struct
sockaddr
*
)
(
&
IPaddr
),
sizeof
(
IPaddr
))
>=
0
)
sizeof
(
IPaddr
))
<
0
)
break
;
{
DBUG_PRINT
(
"error"
,(
"Got error: %d from bind"
,
socket_errno
));
DBUG_PRINT
(
"error"
,(
"Got error: %d from bind"
,
socket_errno
));
sql_perror
(
"Can't start server: Bind on TCP/IP port"
);
/* Had a loop here */
sql_perror
(
"Can't start server: Bind on TCP/IP port"
);
sql_print_error
(
"Do you already have another mysqld server running on port: %d ?"
,
mysql_port
);
sql_print_error
(
"Do you already have another mysqld server running on port: %d ?"
,
mysql_port
);
unireg_abort
(
1
);
unireg_abort
(
1
);
}
}
if
(
listen
(
ip_sock
,(
int
)
back_log
)
<
0
)
if
(
listen
(
ip_sock
,(
int
)
back_log
)
<
0
)
{
sql_perror
(
"Can't start server: listen() on TCP/IP port"
);
sql_print_error
(
"Warning: listen() on TCP/IP failed with error %d"
,
sql_print_error
(
"Warning: listen() on TCP/IP failed with error %d"
,
socket_errno
);
socket_errno
);
unireg_abort
(
1
);
}
}
}
if
(
mysqld_chroot
)
if
(
mysqld_chroot
)
set_root
(
mysqld_chroot
);
set_root
(
mysqld_chroot
);
...
...
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