Commit 1af1c70d authored by unknown's avatar unknown

Portability fixes


include/my_pthread.h:
  Fix for HPUX
mysql-test/mysql-test-run.sh:
  Wait for socket instead of pid file
mysys/my_static.c:
  Portability fix (for OSF1)
mysys/raid.cc:
  Portability fix (for OSF1)
sql/mysqld.cc:
  Fixed typo for FreeBSD.
strings/bcmp.c:
  Fix for purify
parent 640bd569
...@@ -448,6 +448,8 @@ struct hostent *my_gethostbyname_r(const char *name, ...@@ -448,6 +448,8 @@ struct hostent *my_gethostbyname_r(const char *name,
#if defined(HPUX) && !defined(DONT_REMAP_PTHREAD_FUNCTIONS) #if defined(HPUX) && !defined(DONT_REMAP_PTHREAD_FUNCTIONS)
#define pthread_cond_timedwait(a,b,c) my_pthread_cond_timedwait((a),(b),(c)) #define pthread_cond_timedwait(a,b,c) my_pthread_cond_timedwait((a),(b),(c))
int my_pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
struct timespec *abstime);
#endif #endif
/* safe_mutex adds checking to mutex for easier debugging */ /* safe_mutex adds checking to mutex for easier debugging */
......
...@@ -30,7 +30,7 @@ which () ...@@ -30,7 +30,7 @@ which ()
do do
for dir in $PATH for dir in $PATH
do do
if test -f $dir/$file if test -e $dir/$file
then then
echo "$dir/$file" echo "$dir/$file"
continue 2 continue 2
...@@ -49,8 +49,7 @@ sleep_until_file_deleted () ...@@ -49,8 +49,7 @@ sleep_until_file_deleted ()
loop=$SLEEP_TIME_FOR_DELETE loop=$SLEEP_TIME_FOR_DELETE
while (test $loop -gt 0) while (test $loop -gt 0)
do do
sleep 1 if [ ! -e $file ]
if [ ! -f $file ]
then then
return return
fi fi
...@@ -65,11 +64,11 @@ sleep_until_file_exists () ...@@ -65,11 +64,11 @@ sleep_until_file_exists ()
org_time=$2 org_time=$2
while (test $loop -gt 0) while (test $loop -gt 0)
do do
sleep 1 if [ -e $file ]
if [ -f $file ]
then then
return return
fi fi
sleep 1
loop=`expr $loop - 1` loop=`expr $loop - 1`
done done
echo "ERROR: $file was not created in $org_time seconds; Aborting" echo "ERROR: $file was not created in $org_time seconds; Aborting"
...@@ -772,7 +771,7 @@ EOF ...@@ -772,7 +771,7 @@ EOF
else else
manager_launch master $MYSQLD $master_args manager_launch master $MYSQLD $master_args
fi fi
sleep_until_file_exists $MASTER_MYPID $wait_for_master sleep_until_file_exists $MASTER_MYSOCK $wait_for_master
wait_for_master=$SLEEP_TIME_FOR_SECOND_MASTER wait_for_master=$SLEEP_TIME_FOR_SECOND_MASTER
MASTER_RUNNING=1 MASTER_RUNNING=1
} }
...@@ -872,7 +871,7 @@ start_slave() ...@@ -872,7 +871,7 @@ start_slave()
manager_launch $slave_ident $SLAVE_MYSQLD $slave_args manager_launch $slave_ident $SLAVE_MYSQLD $slave_args
fi fi
eval "SLAVE$1_RUNNING=1" eval "SLAVE$1_RUNNING=1"
sleep_until_file_exists $slave_pid $wait_for_slave sleep_until_file_exists $slave_sock $wait_for_slave
wait_for_slave=$SLEEP_TIME_FOR_SECOND_SLAVE wait_for_slave=$SLEEP_TIME_FOR_SECOND_SLAVE
} }
......
...@@ -82,6 +82,13 @@ struct remember *pRememberRoot = NULL; ...@@ -82,6 +82,13 @@ struct remember *pRememberRoot = NULL;
int volatile my_have_got_alarm=0; /* declare variable to reset */ int volatile my_have_got_alarm=0; /* declare variable to reset */
ulong my_time_to_wait_for_lock=2; /* In seconds */ ulong my_time_to_wait_for_lock=2; /* In seconds */
/*
We need to have this define here as otherwise linking will fail
on OSF1 when compiling --without-raid --with-debug
*/
const char *raid_type_string[]={"none","striped"};
/* from errors.c */ /* from errors.c */
#ifdef SHARED_LIBRARY #ifdef SHARED_LIBRARY
char * NEAR globerrs[GLOBERRS]; /* my_error_messages is here */ char * NEAR globerrs[GLOBERRS]; /* my_error_messages is here */
......
...@@ -79,8 +79,6 @@ ...@@ -79,8 +79,6 @@
#include <m_string.h> #include <m_string.h>
#include <assert.h> #include <assert.h>
const char *raid_type_string[]={"none","striped"};
#if defined(USE_RAID) && !defined(MYSQL_CLIENT) #if defined(USE_RAID) && !defined(MYSQL_CLIENT)
#define RAID_SEEK_DONE ~(off_t) 0 #define RAID_SEEK_DONE ~(off_t) 0
......
...@@ -117,7 +117,7 @@ inline void reset_floating_point_exceptions() ...@@ -117,7 +117,7 @@ inline void reset_floating_point_exceptions()
#if defined(__i386__) #if defined(__i386__)
fpsetmask(~(FP_X_INV | FP_X_DNML | FP_X_OFL | FP_X_UFL | FP_X_DZ | fpsetmask(~(FP_X_INV | FP_X_DNML | FP_X_OFL | FP_X_UFL | FP_X_DZ |
FP_X_IMP)); FP_X_IMP));
else #else
fpsetmask(~(FP_X_INV | FP_X_OFL | FP_X_UFL | FP_X_DZ | fpsetmask(~(FP_X_INV | FP_X_OFL | FP_X_UFL | FP_X_DZ |
FP_X_IMP)); FP_X_IMP));
#endif #endif
......
...@@ -18,12 +18,18 @@ ...@@ -18,12 +18,18 @@
bcmp(s1, s2, len) returns 0 if the "len" bytes starting at "s1" are bcmp(s1, s2, len) returns 0 if the "len" bytes starting at "s1" are
identical to the "len" bytes starting at "s2", non-zero if they are identical to the "len" bytes starting at "s2", non-zero if they are
different. different.
Now only used with purify. Now only used with purify because purify gives wrong warnings when
comparing a shorter string with bcmp.
*/ */
#include <my_global.h> #include <my_global.h>
#include "m_string.h" #include "m_string.h"
#ifdef HAVE_purify
#undef bcmp
#undef HAVE_BCMP
#endif
#if !defined(bcmp) && !defined(HAVE_BCMP) #if !defined(bcmp) && !defined(HAVE_BCMP)
#if defined(MC68000) && defined(DS90) #if defined(MC68000) && defined(DS90)
...@@ -45,14 +51,7 @@ uint len; /* 0 <= len <= 65535 */ ...@@ -45,14 +51,7 @@ uint len; /* 0 <= len <= 65535 */
#else #else
#ifdef HAVE_purify int bcmp(register const char *s1,register const char *s2, register uint len)
int my_bcmp(s1, s2, len)
#else
int bcmp(s1, s2, len)
#endif
register const char *s1;
register const char *s2;
register uint len;
{ {
while (len-- != 0 && *s1++ == *s2++) ; while (len-- != 0 && *s1++ == *s2++) ;
return len+1; return len+1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment