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
f5144a8a
Commit
f5144a8a
authored
Mar 08, 2003
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A correct fix for the timeout problem
parent
157b3667
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
7 deletions
+4
-7
libmysql/libmysql.c
libmysql/libmysql.c
+4
-7
No files found.
libmysql/libmysql.c
View file @
f5144a8a
...
@@ -121,7 +121,7 @@ static int connect2(my_socket s, const struct sockaddr *name, uint namelen,
...
@@ -121,7 +121,7 @@ static int connect2(my_socket s, const struct sockaddr *name, uint namelen,
#if defined(__WIN__) || defined(OS2)
#if defined(__WIN__) || defined(OS2)
return
connect
(
s
,
(
struct
sockaddr
*
)
name
,
namelen
);
return
connect
(
s
,
(
struct
sockaddr
*
)
name
,
namelen
);
#else
#else
int
flags
,
res
,
s_err
;
int
flags
,
res
,
s_err
,
result
=
0
;
SOCKOPT_OPTLEN_TYPE
s_err_size
=
sizeof
(
uint
);
SOCKOPT_OPTLEN_TYPE
s_err_size
=
sizeof
(
uint
);
fd_set
sfds
;
fd_set
sfds
;
struct
timeval
tv
;
struct
timeval
tv
;
...
@@ -175,19 +175,16 @@ static int connect2(my_socket s, const struct sockaddr *name, uint namelen,
...
@@ -175,19 +175,16 @@ static int connect2(my_socket s, const struct sockaddr *name, uint namelen,
* implementations of select that don't adjust tv upon
* implementations of select that don't adjust tv upon
* failure to reflect the time remaining
* failure to reflect the time remaining
*/
*/
#ifdef HAVE_POLL
return
(
0
);
#endif
start_time
=
time
(
NULL
);
start_time
=
time
(
NULL
);
for
(;;)
for
(;;)
{
{
tv
.
tv_sec
=
(
long
)
timeout
;
tv
.
tv_sec
=
(
long
)
timeout
;
tv
.
tv_usec
=
0
;
tv
.
tv_usec
=
0
;
#if defined(HPUX) && defined(THREAD)
#if defined(HPUX) && defined(THREAD)
if
((
res
=
select
(
s
+
1
,
NULL
,
(
int
*
)
&
sfds
,
NULL
,
&
tv
))
>=
0
)
if
((
res
ult
=
select
(
s
+
1
,
NULL
,
(
int
*
)
&
sfds
,
NULL
,
&
tv
))
>=
0
)
break
;
break
;
#else
#else
if
((
res
=
select
(
s
+
1
,
NULL
,
&
sfds
,
NULL
,
&
tv
))
>=
0
)
if
((
res
ult
=
select
(
s
+
1
,
NULL
,
&
sfds
,
NULL
,
&
tv
))
>=
0
)
break
;
break
;
#endif
#endif
now_time
=
time
(
NULL
);
now_time
=
time
(
NULL
);
...
@@ -210,7 +207,7 @@ static int connect2(my_socket s, const struct sockaddr *name, uint namelen,
...
@@ -210,7 +207,7 @@ static int connect2(my_socket s, const struct sockaddr *name, uint namelen,
errno
=
s_err
;
errno
=
s_err
;
return
(
-
1
);
/* but return an error... */
return
(
-
1
);
/* but return an error... */
}
}
return
(
0
);
/* It's all good! */
return
(
(
res
)
?
res
:
result
);
/* It's all good! */
#endif
#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