Commit 1904d7a8 authored by monty@hundin.mysql.fi's avatar monty@hundin.mysql.fi

Portability fixes

parent 7d6e8ee7
......@@ -448,6 +448,8 @@ struct hostent *my_gethostbyname_r(const char *name,
#if defined(HPUX) && !defined(DONT_REMAP_PTHREAD_FUNCTIONS)
#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
/* safe_mutex adds checking to mutex for easier debugging */
......
......@@ -30,7 +30,7 @@ which ()
do
for dir in $PATH
do
if test -f $dir/$file
if test -e $dir/$file
then
echo "$dir/$file"
continue 2
......@@ -49,8 +49,7 @@ sleep_until_file_deleted ()
loop=$SLEEP_TIME_FOR_DELETE
while (test $loop -gt 0)
do
sleep 1
if [ ! -f $file ]
if [ ! -e $file ]
then
return
fi
......@@ -65,11 +64,11 @@ sleep_until_file_exists ()
org_time=$2
while (test $loop -gt 0)
do
sleep 1
if [ -f $file ]
if [ -e $file ]
then
return
fi
sleep 1
loop=`expr $loop - 1`
done
echo "ERROR: $file was not created in $org_time seconds; Aborting"
......@@ -772,7 +771,7 @@ EOF
else
manager_launch master $MYSQLD $master_args
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
MASTER_RUNNING=1
}
......@@ -872,7 +871,7 @@ start_slave()
manager_launch $slave_ident $SLAVE_MYSQLD $slave_args
fi
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
}
......
......@@ -82,6 +82,13 @@ struct remember *pRememberRoot = NULL;
int volatile my_have_got_alarm=0; /* declare variable to reset */
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 */
#ifdef SHARED_LIBRARY
char * NEAR globerrs[GLOBERRS]; /* my_error_messages is here */
......
......@@ -79,8 +79,6 @@
#include <m_string.h>
#include <assert.h>
const char *raid_type_string[]={"none","striped"};
#if defined(USE_RAID) && !defined(MYSQL_CLIENT)
#define RAID_SEEK_DONE ~(off_t) 0
......
......@@ -117,7 +117,7 @@ inline void reset_floating_point_exceptions()
#if defined(__i386__)
fpsetmask(~(FP_X_INV | FP_X_DNML | FP_X_OFL | FP_X_UFL | FP_X_DZ |
FP_X_IMP));
else
#else
fpsetmask(~(FP_X_INV | FP_X_OFL | FP_X_UFL | FP_X_DZ |
FP_X_IMP));
#endif
......
......@@ -18,12 +18,18 @@
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
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 "m_string.h"
#ifdef HAVE_purify
#undef bcmp
#undef HAVE_BCMP
#endif
#if !defined(bcmp) && !defined(HAVE_BCMP)
#if defined(MC68000) && defined(DS90)
......@@ -45,14 +51,7 @@ uint len; /* 0 <= len <= 65535 */
#else
#ifdef HAVE_purify
int my_bcmp(s1, s2, len)
#else
int bcmp(s1, s2, len)
#endif
register const char *s1;
register const char *s2;
register uint len;
int bcmp(register const char *s1,register const char *s2, register uint len)
{
while (len-- != 0 && *s1++ == *s2++) ;
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