=== modified file 'configure.in' --- configure.in 2007-06-20 22:11:55 +0000 +++ configure.in 2007-06-20 22:54:18 +0000 @@ -1801,7 +1801,8 @@ again]); fi fi -AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include ]) +AC_CHECK_TYPES([off_t], [], [], [#include ]) +AC_CHECK_TYPES([sigset_t], [], [], [#include ]) AC_CHECK_TYPES([size_t], [], [], [#include ]) AC_CHECK_TYPES([u_int32_t]) @@ -1898,7 +1899,7 @@ chsize cuserid fchmod fcntl \ fconvert fdatasync finite fpresetsticky fpsetmask fsync ftruncate \ getcwd gethostbyaddr_r gethostbyname_r getpass getpassphrase getpwnam \ - getpwuid getrlimit getrusage getwd gmtime_r index initgroups isnan \ + getpwuid getrlimit getrusage getwd gmtime_r index initgroups \ localtime_r locking longjmp lrand48 madvise mallinfo memcpy memmove \ mkstemp mlockall perror poll pread pthread_attr_create mmap mmap64 getpagesize \ pthread_attr_getstacksize pthread_attr_setprio pthread_attr_setschedparam \ @@ -1927,11 +1928,19 @@ esac # isinf() could be a function or a macro (HPUX) +# although according to ISO C, it must be a macro AC_MSG_CHECKING(for isinf with ) AC_TRY_LINK([#include ], [float f = 0.0; int r = isinf(f); return r], AC_MSG_RESULT(yes) AC_DEFINE(HAVE_ISINF, [1], [isinf() macro or function]), AC_MSG_RESULT(no)) + +# do the same check for isnan +AC_MSG_CHECKING(for isnan with ) +AC_TRY_LINK([#include ], [float f = 0.0; int r = isnan(f); return r], + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_ISNAN, [1], [isnan() macro or function]), + AC_MSG_RESULT(no)) CFLAGS="$ORG_CFLAGS" === modified file 'mysys/my_gethwaddr.c' --- mysys/my_gethwaddr.c 2007-06-20 22:11:55 +0000 +++ mysys/my_gethwaddr.c 2007-06-20 22:56:09 +0000 @@ -30,6 +30,14 @@ return res; } +#ifdef HAVE_SYS_IOCTL_H +#include +#endif + +#ifdef HAVE_SYS_SOCKET_H +#include +#endif + #ifdef __FreeBSD__ #include @@ -73,7 +81,6 @@ #elif __linux__ #include -#include #include my_bool my_gethwaddr(uchar *to) === modified file 'mysys/my_lib.c' --- mysys/my_lib.c 2007-06-20 22:11:55 +0000 +++ mysys/my_lib.c 2007-06-20 22:50:51 +0000 @@ -105,7 +105,7 @@ struct dirent *dp; char tmp_path[FN_REFLEN+1],*tmp_file; #ifdef THREAD - char dirent_tmp[sizeof(struct dirent)+_POSIX_PATH_MAX+1]; + char dirent_tmp[sizeof(struct dirent)+PATH_MAX+1]; #endif DBUG_ENTER("my_dir"); DBUG_PRINT("my",("path: '%s' MyFlags: %d",path,MyFlags)); === modified file 'sql/net_serv.cc' --- sql/net_serv.cc 2007-06-20 22:11:55 +0000 +++ sql/net_serv.cc 2007-06-20 22:50:51 +0000 @@ -47,6 +47,11 @@ #include #include #include + +#ifdef HAVE_POLL +#include +#endif + #ifdef __NETWARE__ #include #endif === modified file 'storage/innobase/os/os0file.c' --- storage/innobase/os/os0file.c 2007-06-20 22:11:55 +0000 +++ storage/innobase/os/os0file.c 2007-06-20 22:50:51 +0000 @@ -722,8 +722,8 @@ struct stat statinfo; #ifdef HAVE_READDIR_R char dirent_buf[sizeof(struct dirent) - + _POSIX_PATH_MAX + 100]; - /* In /mysys/my_lib.c, _POSIX_PATH_MAX + 1 is used as + + PATH_MAX + 100]; + /* In /mysys/my_lib.c, PATH_MAX + 1 is used as the max file name len; but in most standards, the length is NAME_MAX; we add 100 to be even safer */ #endif @@ -747,7 +747,7 @@ return(1); } - ut_a(strlen(ent->d_name) < _POSIX_PATH_MAX + 100 - 1); + ut_a(strlen(ent->d_name) < PATH_MAX + 100 - 1); #else ent = readdir(dir); === modified file 'storage/ndb/src/common/portlib/NdbTCP.cpp' --- storage/ndb/src/common/portlib/NdbTCP.cpp 2007-06-20 22:11:55 +0000 +++ storage/ndb/src/common/portlib/NdbTCP.cpp 2007-06-20 22:50:51 +0000 @@ -18,6 +18,10 @@ #include #include +#ifdef HAVE_POLL +#include +#endif + extern "C" int Ndb_getInAddr(struct in_addr * dst, const char *address) { === modified file 'storage/ndb/src/cw/cpcd/Process.cpp' --- storage/ndb/src/cw/cpcd/Process.cpp 2007-06-20 22:11:55 +0000 +++ storage/ndb/src/cw/cpcd/Process.cpp 2007-06-20 22:50:51 +0000 @@ -22,10 +22,29 @@ #include "CPCD.hpp" #include + +#ifdef HAVE_UNISTD_H +#include +#endif + #ifdef HAVE_GETRLIMIT #include #endif +/* getdtablesize() isn't always guaranteed to be there */ + +int +local_getdtablesize() { +#ifdef HAVE_GETRLIMIT + struct rlimit rlim; + + if (getrlimit(RLIMIT_NOFILE, &rlim) == 0) + return (int)rlim.rlim_cur; + else +#endif + return (int)sysconf(_SC_OPEN_MAX); +} + void CPCD::Process::print(FILE * f){ fprintf(f, "define process\n"); @@ -316,7 +335,7 @@ } /* Close all filedescriptors */ - for(i = STDERR_FILENO+1; (int)i < getdtablesize(); i++) + for(i = STDERR_FILENO+1; (int)i < local_getdtablesize(); i++) close(i); execv(m_path.c_str(), argv);