#!!! notice !!!
# Any small change to this file in the main branch
# should be done or reviewed by the maintainer!
-diff -ruN a/patch_info/remove_fcntl_excessive_calls.info b/patch_info/remove_fcntl_excessive_calls.info
---- a/patch_info/remove_fcntl_excessive_calls.info 1970-01-01 03:00:00.000000000 +0300
-+++ b/patch_info/remove_fcntl_excessive_calls.info 2010-07-22 21:42:08.560424001 +0400
+--- /dev/null
++++ b/patch_info/remove_fcntl_excessive_calls.info
@@ -0,0 +1,6 @@
+File=remove_fcntl_excessive_calls.patch
+Name=remove fcntl excessive calls
+Author=This is a port of the official fix.
+License=GPL
+Comment=
-diff -ruN a/sql/net_serv.cc b/sql/net_serv.cc
---- a/sql/net_serv.cc 2010-06-03 19:50:27.000000000 +0400
-+++ b/sql/net_serv.cc 2010-07-22 21:40:30.680424001 +0400
+--- a/sql/net_serv.cc
++++ b/sql/net_serv.cc
+@@ -61,7 +61,7 @@
+ the client should have a bigger max_allowed_packet.
+ */
+
+-#if defined(__WIN__) || !defined(MYSQL_SERVER)
++#if (defined(__WIN__) || !defined(MYSQL_SERVER)) && !defined(NO_ALARM)
+ /* The following is because alarms doesn't work on windows. */
+ #ifndef NO_ALARM
+ #define NO_ALARM
@@ -133,7 +133,7 @@
if (vio != 0) /* If real connection */
{
if (!(test_flags & TEST_BLOCKING))
{
my_bool old_mode;
-@@ -642,7 +642,7 @@
+@@ -632,7 +632,7 @@
if ((long) (length= vio_write(net->vio,pos,(size_t) (end-pos))) <= 0)
{
my_bool interrupted = vio_should_retry(net->vio);
if ((interrupted || length == 0) && !thr_alarm_in_use(&alarmed))
{
if (!thr_alarm(&alarmed, net->write_timeout, &alarm_buff))
-@@ -680,7 +680,7 @@
- my_progname);
- #endif /* EXTRA_DEBUG */
- }
--#if defined(THREAD_SAFE_CLIENT) && !defined(MYSQL_SERVER)
-+#if defined(THREAD_SAFE_CLIENT) && defined(NO_ALARM)
- if (vio_errno(net->vio) == SOCKET_EINTR)
- {
- DBUG_PRINT("warning",("Interrupted write. Retrying..."));
-@@ -698,7 +698,7 @@
+@@ -688,7 +688,7 @@
pos+=length;
update_statistics(thd_increment_bytes_sent(length));
}
end:
#endif
#ifdef HAVE_COMPRESS
-@@ -830,6 +830,7 @@
+@@ -820,6 +820,7 @@
thr_alarm(&alarmed,net->read_timeout,&alarm_buff);
#else
/* Read timeout is set in my_net_set_read_timeout */
#endif /* NO_ALARM */
pos = net->buff + net->where_b; /* net->packet -4 */
-@@ -844,7 +845,7 @@
+@@ -834,7 +835,7 @@
DBUG_PRINT("info",("vio_read returned %ld errno: %d",
(long) length, vio_errno(net->vio)));
/*
We got an error that there was no data on the socket. We now set up
an alarm to not 'read forever', change the socket to non blocking
-@@ -891,7 +892,7 @@
- my_progname,vio_errno(net->vio));
- #endif /* EXTRA_DEBUG */
- }
--#if defined(THREAD_SAFE_CLIENT) && !defined(MYSQL_SERVER)
-+#if defined(THREAD_SAFE_CLIENT) && defined(NO_ALARM)
- if (vio_errno(net->vio) == SOCKET_EINTR)
- {
- DBUG_PRINT("warning",("Interrupted read. Retrying..."));