Hi,

This patch fixes errno usage. Often in mysql there is assumption
that errno is simple int variable while it is not in glibc (>=2.3.1).
It's a macro.

See
http://lists.debian.org/debian-glibc/2002/debian-glibc-200212/msg00364.html

Patch by Artur Frysiak <[EMAIL PROTECTED]> that fixes that (and thus allows
compiling on glibc >= 2.3.1). There is simpler patch doing the same
thing here 
http://lists.mysql.com/cgi-ez/ezmlm-cgi?1:mss:133487:200302:ioffpbhpdaoihkbckdio

Also these patches were ignored while they are fixing real bugs:
http://lists.mysql.com/cgi-ez/ezmlm-cgi?1:mss:132400:200302:fhigljdnohbmleilklpi


--- mysql-4.0.11a-gamma/mysys/mf_cache.c.wiget  Tue Mar  4 16:03:44 2003
+++ mysql-4.0.11a-gamma/mysys/mf_cache.c        Tue Mar  4 16:04:19 2003
@@ -20,6 +20,7 @@
 #include <m_string.h>
 #include "my_static.h"
 #include "mysys_err.h"
+#include <errno.h>
 
        /*
          Remove an open tempfile so that it doesn't survive
--- mysql-4.0.11a-gamma/mysys/my_copy.c.wiget   Tue Mar  4 16:06:02 2003
+++ mysql-4.0.11a-gamma/mysys/my_copy.c Tue Mar  4 16:06:20 2003
@@ -29,6 +29,7 @@
   time_t modtime;
 };
 #endif
+#include <errno.h>
 
 
        /*
--- mysql-4.0.11a-gamma/mysys/my_chsize.c.wiget Tue Mar  4 16:04:38 2003
+++ mysql-4.0.11a-gamma/mysys/my_chsize.c       Tue Mar  4 16:05:47 2003
@@ -17,6 +17,7 @@
 #include "mysys_priv.h"
 #include "mysys_err.h"
 #include "m_string.h"
+#include <errno.h>
 
 /*
   Change size of file.
--- mysql-4.0.11a-gamma/mysys/my_error.c.wiget  Tue Mar  4 16:06:58 2003
+++ mysql-4.0.11a-gamma/mysys/my_error.c        Tue Mar  4 16:07:11 2003
@@ -19,6 +19,7 @@
 #include <m_string.h>
 #include <stdarg.h>
 #include <m_ctype.h>
+#include <errno.h>
 
 /* Define some external variables for error handling */
 
--- mysql-4.0.11a-gamma/mysys/my_delete.c.wiget Tue Mar  4 16:06:34 2003
+++ mysql-4.0.11a-gamma/mysys/my_delete.c       Tue Mar  4 16:06:45 2003
@@ -16,6 +16,7 @@
 
 #include "mysys_priv.h"
 #include "mysys_err.h"
+#include <errno.h>
 
 int my_delete(const char *name, myf MyFlags)
 {
--- mysql-4.0.11a-gamma/mysys/my_getwd.c.wiget  Tue Mar  4 16:08:45 2003
+++ mysql-4.0.11a-gamma/mysys/my_getwd.c        Tue Mar  4 16:08:59 2003
@@ -30,6 +30,7 @@
 #if defined(OS2)
 #include <direct.h>
 #endif
+#include <errno.h>
 
 #ifdef __EMX__
 /* chdir2 support also drive change */
--- mysql-4.0.11a-gamma/mysys/my_gethostbyname.c.wiget  Tue Mar  4 16:07:30 2003
+++ mysql-4.0.11a-gamma/mysys/my_gethostbyname.c        Tue Mar  4 16:08:13 2003
@@ -23,6 +23,7 @@
 #include <netdb.h>
 #endif
 #include <my_net.h>
+#include <errno.h>
 
 /* This file is not needed if my_gethostbyname_r is a macro */
 #if !defined(my_gethostbyname_r)
--- mysql-4.0.11a-gamma/mysys/my_lib.c.wiget    Tue Mar  4 16:09:10 2003
+++ mysql-4.0.11a-gamma/mysys/my_lib.c  Tue Mar  4 16:09:24 2003
@@ -51,6 +51,7 @@
 #include <iodef.h>
 #include <descrip.h>
 #endif
+#include <errno.h>
 
 #ifdef OS2
 #include "my_os2dirsrch.h"
--- mysql-4.0.11a-gamma/mysys/my_lockmem.c.wiget        Tue Mar  4 16:09:36 2003
+++ mysql-4.0.11a-gamma/mysys/my_lockmem.c      Tue Mar  4 16:09:54 2003
@@ -19,6 +19,7 @@
 #include "mysys_priv.h"
 #include "mysys_err.h"
 #include <my_list.h>
+#include <errno.h>
 
 #ifdef HAVE_MLOCK
 #include <sys/mman.h>
--- mysql-4.0.11a-gamma/mysys/my_lread.c.wiget  Tue Mar  4 16:10:06 2003
+++ mysql-4.0.11a-gamma/mysys/my_lread.c        Tue Mar  4 16:10:17 2003
@@ -16,6 +16,7 @@
 
 #include "mysys_priv.h"
 #include "mysys_err.h"
+#include <errno.h>
 
        /* Read a chunk of bytes from a file  */
 
--- mysql-4.0.11a-gamma/mysys/my_mkdir.c.wiget  Tue Mar  4 16:11:03 2003
+++ mysql-4.0.11a-gamma/mysys/my_mkdir.c        Tue Mar  4 16:11:14 2003
@@ -21,6 +21,7 @@
 #ifdef __WIN__
 #include <direct.h>
 #endif
+#include <errno.h>
 
 int my_mkdir(const char *dir, int Flags, myf MyFlags)
 {
--- mysql-4.0.11a-gamma/mysys/my_lwrite.c.wiget Tue Mar  4 16:10:26 2003
+++ mysql-4.0.11a-gamma/mysys/my_lwrite.c       Tue Mar  4 16:10:36 2003
@@ -16,6 +16,7 @@
 
 #include "mysys_priv.h"
 #include "mysys_err.h"
+#include <errno.h>
 
        /* Write a chunk of bytes to a file */
 
--- mysql-4.0.11a-gamma/mysys/my_malloc.c.wiget Tue Mar  4 16:10:45 2003
+++ mysql-4.0.11a-gamma/mysys/my_malloc.c       Tue Mar  4 16:10:55 2003
@@ -21,6 +21,7 @@
 #include "mysys_priv.h"
 #include "mysys_err.h"
 #include <m_string.h>
+#include <errno.h>
 
        /* My memory allocator */
 
--- mysql-4.0.11a-gamma/mysys/my_once.c.wiget   Tue Mar  4 16:11:25 2003
+++ mysql-4.0.11a-gamma/mysys/my_once.c Tue Mar  4 16:11:34 2003
@@ -23,6 +23,7 @@
 #include "mysys_priv.h"
 #include "my_static.h"
 #include "mysys_err.h"
+#include <errno.h>
 
 /*
   Alloc for things we don't nead to free
--- mysql-4.0.11a-gamma/mysys/my_os2file64.c.wiget      Tue Mar  4 16:11:55 2003
+++ mysql-4.0.11a-gamma/mysys/my_os2file64.c    Tue Mar  4 16:12:11 2003
@@ -18,6 +18,8 @@
    Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
    MA 02111-1307, USA */
 
+#include <errno.h>
+
 void       _OS2errno( APIRET rc);
 longlong    _lseek64( int fd, longlong offset, int seektype);
 int        _lock64( int fd, int locktype, my_off_t start,
--- mysql-4.0.11a-gamma/mysys/my_os2thread.c.wiget      Tue Mar  4 16:12:23 2003
+++ mysql-4.0.11a-gamma/mysys/my_os2thread.c    Tue Mar  4 16:12:36 2003
@@ -23,6 +23,7 @@
 *****************************************************************************/
 
 #include "mysys_priv.h"
+#include <errno.h>
 #if defined(THREAD) && defined(OS2)
 #include <m_string.h>
 #include <process.h>
--- mysql-4.0.11a-gamma/mysys/my_pthread.c.wiget        Tue Mar  4 16:12:49 2003
+++ mysql-4.0.11a-gamma/mysys/my_pthread.c      Tue Mar  4 16:13:04 2003
@@ -19,6 +19,7 @@
 #define DONT_REMAP_PTHREAD_FUNCTIONS
 
 #include "mysys_priv.h"
+#include <errno.h>
 #ifdef THREAD
 #include <signal.h>
 #include <m_string.h>
--- mysql-4.0.11a-gamma/mysys/my_quick.c.wiget  Tue Mar  4 16:13:13 2003
+++ mysql-4.0.11a-gamma/mysys/my_quick.c        Tue Mar  4 16:13:22 2003
@@ -18,6 +18,7 @@
 
 #include "mysys_priv.h"
 #include "my_nosys.h"
+#include <errno.h>
 
 
 uint my_quick_read(File Filedes,byte *Buffer,uint Count,myf MyFlags)
--- mysql-4.0.11a-gamma/mysys/my_realloc.c.wiget        Tue Mar  4 16:13:36 2003
+++ mysql-4.0.11a-gamma/mysys/my_realloc.c      Tue Mar  4 16:13:48 2003
@@ -20,6 +20,7 @@
 
 #include "mysys_priv.h"
 #include "mysys_err.h"
+#include <errno.h>
 
        /* My memory re allocator */
 
--- mysql-4.0.11a-gamma/mysys/my_redel.c.wiget  Tue Mar  4 16:13:57 2003
+++ mysql-4.0.11a-gamma/mysys/my_redel.c        Tue Mar  4 16:14:12 2003
@@ -29,6 +29,7 @@
   time_t modtime;
 };
 #endif
+#include <errno.h>
 
        /*
          Rename with copy stat form old file
--- mysql-4.0.11a-gamma/mysys/my_seek.c.wiget   Tue Mar  4 16:14:41 2003
+++ mysql-4.0.11a-gamma/mysys/my_seek.c Tue Mar  4 16:14:53 2003
@@ -15,6 +15,7 @@
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
 #include "mysys_priv.h"
+#include <errno.h>
 
        /* Seek to position in file */
        /*ARGSUSED*/
--- mysql-4.0.11a-gamma/mysys/my_rename.c.wiget Tue Mar  4 16:14:20 2003
+++ mysql-4.0.11a-gamma/mysys/my_rename.c       Tue Mar  4 16:14:33 2003
@@ -18,6 +18,7 @@
 #include "mysys_priv.h"
 #include <my_dir.h>
 #include "mysys_err.h"
+#include <errno.h>
 
 #undef my_rename
        /* On unix rename deletes to file if it exists */
--- mysql-4.0.11a-gamma/mysys/my_tempnam.c.wiget        Tue Mar  4 16:15:26 2003
+++ mysql-4.0.11a-gamma/mysys/my_tempnam.c      Tue Mar  4 16:15:37 2003
@@ -23,6 +23,7 @@
 
 #include "mysys_priv.h"
 #include <m_string.h>
+#include <errno.h>
 
 /* HPUX 11.0 doesn't allow us to change the environ pointer */
 #ifdef HPUX11
--- mysql-4.0.11a-gamma/mysys/my_thr_init.c.wiget       Tue Mar  4 16:15:46 2003
+++ mysql-4.0.11a-gamma/mysys/my_thr_init.c     Tue Mar  4 16:16:40 2003
@@ -21,6 +21,7 @@
 
 #include "mysys_priv.h"
 #include <m_string.h>
+#include <errno.h>
 
 #ifdef THREAD
 #ifdef USE_TLS
--- mysql-4.0.11a-gamma/mysys/safemalloc.c.wiget        Tue Mar  4 16:17:29 2003
+++ mysql-4.0.11a-gamma/mysys/safemalloc.c      Tue Mar  4 16:18:05 2003
@@ -68,6 +68,7 @@
 #include <m_string.h>
 #include "my_static.h"
 #include "mysys_err.h"
+#include <errno.h>
 
 ulonglong safemalloc_mem_limit = ~(ulonglong)0;
 
--- mysql-4.0.11a-gamma/mysys/thr_mutex.c.wiget Tue Mar  4 16:18:32 2003
+++ mysql-4.0.11a-gamma/mysys/thr_mutex.c       Tue Mar  4 16:18:50 2003
@@ -17,6 +17,7 @@
 /* This makes a wrapper for mutex handling to make it easier to debug mutex */
 
 #include <my_global.h>
+#include <errno.h>
 #if defined(HAVE_LINUXTHREADS) && !defined (__USE_UNIX98)
 #define __USE_UNIX98                   /* To get rw locks under Linux */
 #endif

-- 
Arkadiusz Miśkiewicz, Grupa BeeProvider - http://www.beep.pl/


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to