]> git.pld-linux.org Git - packages/mysql.git/blob - remove_fcntl_excessive_calls.patch
- up to 5.5.9
[packages/mysql.git] / remove_fcntl_excessive_calls.patch
1 # name       : remove_fcntl_excessive_calls.patch
2 # introduced : 12
3 # maintainer : Oleg
4 #
5 #!!! notice !!!
6 # Any small change to this file in the main branch
7 # should be done or reviewed by the maintainer!
8 diff -ruN a/patch_info/remove_fcntl_excessive_calls.info b/patch_info/remove_fcntl_excessive_calls.info
9 --- a/patch_info/remove_fcntl_excessive_calls.info      1970-01-01 03:00:00.000000000 +0300
10 +++ b/patch_info/remove_fcntl_excessive_calls.info      2010-07-22 21:42:08.560424001 +0400
11 @@ -0,0 +1,6 @@
12 +File=remove_fcntl_excessive_calls.patch
13 +Name=remove fcntl excessive calls
14 +Version=1.0
15 +Author=This is a port of the official fix.
16 +License=GPL
17 +Comment=
18 diff -ruN a/sql/net_serv.cc b/sql/net_serv.cc
19 --- a/sql/net_serv.cc   2010-06-03 19:50:27.000000000 +0400
20 +++ b/sql/net_serv.cc   2010-07-22 21:40:30.680424001 +0400
21 @@ -133,7 +133,7 @@
22    if (vio != 0)                                        /* If real connection */
23    {
24      net->fd  = vio_fd(vio);                    /* For perl DBI/DBD */
25 -#if defined(MYSQL_SERVER) && !defined(__WIN__)
26 +#if defined(MYSQL_SERVER) && !defined(__WIN__) && !defined(NO_ALARM)
27      if (!(test_flags & TEST_BLOCKING))
28      {
29        my_bool old_mode;
30 @@ -632,7 +632,7 @@
31      if ((long) (length= vio_write(net->vio,pos,(size_t) (end-pos))) <= 0)
32      {
33        my_bool interrupted = vio_should_retry(net->vio);
34 -#if !defined(__WIN__)
35 +#if !defined(NO_ALARM) && !defined(__WIN__)
36        if ((interrupted || length == 0) && !thr_alarm_in_use(&alarmed))
37        {
38          if (!thr_alarm(&alarmed, net->write_timeout, &alarm_buff))
39 @@ -670,7 +670,7 @@
40                   my_progname);
41  #endif /* EXTRA_DEBUG */
42        }
43 -#if defined(THREAD_SAFE_CLIENT) && !defined(MYSQL_SERVER)
44 +#if defined(THREAD_SAFE_CLIENT) && defined(NO_ALARM)
45        if (vio_errno(net->vio) == SOCKET_EINTR)
46        {
47         DBUG_PRINT("warning",("Interrupted write. Retrying..."));
48 @@ -688,7 +688,7 @@
49      pos+=length;
50      update_statistics(thd_increment_bytes_sent(length));
51    }
52 -#ifndef __WIN__
53 +#if !defined(NO_ALARM) && !defined(__WIN__)
54   end:
55  #endif
56  #ifdef HAVE_COMPRESS
57 @@ -820,6 +820,7 @@
58      thr_alarm(&alarmed,net->read_timeout,&alarm_buff);
59  #else
60    /* Read timeout is set in my_net_set_read_timeout */
61 +  DBUG_ASSERT(net_blocking);
62  #endif /* NO_ALARM */
63  
64      pos = net->buff + net->where_b;            /* net->packet -4 */
65 @@ -834,7 +835,7 @@
66  
67           DBUG_PRINT("info",("vio_read returned %ld  errno: %d",
68                              (long) length, vio_errno(net->vio)));
69 -#if !defined(__WIN__) || defined(MYSQL_SERVER)
70 +#if !defined(NO_ALARM) && (!defined(__WIN__) || defined(MYSQL_SERVER))
71           /*
72             We got an error that there was no data on the socket. We now set up
73             an alarm to not 'read forever', change the socket to non blocking
74 @@ -881,7 +882,7 @@
75                     my_progname,vio_errno(net->vio));
76  #endif /* EXTRA_DEBUG */
77           }
78 -#if defined(THREAD_SAFE_CLIENT) && !defined(MYSQL_SERVER)
79 +#if defined(THREAD_SAFE_CLIENT) && defined(NO_ALARM)
80           if (vio_errno(net->vio) == SOCKET_EINTR)
81           {
82             DBUG_PRINT("warning",("Interrupted read. Retrying..."));
This page took 0.055454 seconds and 4 git commands to generate.