summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2002-08-21 22:12:13 +0300
committerunknown <monty@hundin.mysql.fi>2002-08-21 22:12:13 +0300
commit7ba2adcc0184aaa72ec284de6930f0ae0c72852c (patch)
treeec38df94654d35e1420c29d8fe62cfd281eca1b5 /mysys
parentc53c7ff244a44173ce13c46383a2926055d5c49e (diff)
parent87f9ad3724a8644de4ba10f6247fe194a3d08457 (diff)
downloadmariadb-git-7ba2adcc0184aaa72ec284de6930f0ae0c72852c.tar.gz
merge
Diffstat (limited to 'mysys')
-rw-r--r--mysys/mf_iocache.c5
-rw-r--r--mysys/mf_iocache2.c2
-rw-r--r--mysys/thr_alarm.c23
-rw-r--r--mysys/thr_mutex.c4
4 files changed, 21 insertions, 13 deletions
diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c
index 6f7fb907ad5..43b3d30915f 100644
--- a/mysys/mf_iocache.c
+++ b/mysys/mf_iocache.c
@@ -392,8 +392,8 @@ int _my_b_read(register IO_CACHE *info, byte *Buffer, uint Count)
if ((read_length=my_read(info->file,Buffer,(uint) length,info->myflags))
!= (uint) length)
{
- info->error= read_length == (uint) -1 ? -1 :
- (int) (read_length+left_length);
+ info->error= (read_length == (uint) -1 ? -1 :
+ (int) (read_length+left_length));
DBUG_RETURN(1);
}
Count-=length;
@@ -422,6 +422,7 @@ int _my_b_read(register IO_CACHE *info, byte *Buffer, uint Count)
{
if (length != (uint) -1)
memcpy(Buffer,info->buffer,(size_t) length);
+ info->pos_in_file= pos_in_file;
info->error= length == (uint) -1 ? -1 : (int) (length+left_length);
info->read_pos=info->read_end=info->buffer;
DBUG_RETURN(1);
diff --git a/mysys/mf_iocache2.c b/mysys/mf_iocache2.c
index 21979b99285..344b7ac2251 100644
--- a/mysys/mf_iocache2.c
+++ b/mysys/mf_iocache2.c
@@ -220,7 +220,7 @@ my_off_t my_b_filelength(IO_CACHE *info)
}
else
{
- info->seek_not_done=0;
+ info->seek_not_done=1;
return my_seek(info->file,0L,MY_SEEK_END,MYF(0));
}
}
diff --git a/mysys/thr_alarm.c b/mysys/thr_alarm.c
index c75b43ad0fc..902b8212cca 100644
--- a/mysys/thr_alarm.c
+++ b/mysys/thr_alarm.c
@@ -223,7 +223,8 @@ void thr_end_alarm(thr_alarm_t *alarmed)
printf("Warning: Didn't find alarm %lx in queue of %d alarms\n",
(long) *alarmed, alarm_queue.elements);
#endif
- DBUG_PRINT("warning",("Didn't find alarm %lx in queue\n",*alarmed));
+ DBUG_PRINT("warning",("Didn't find alarm %lx in queue\n",
+ (long) *alarmed));
}
if (alarm_aborted && !alarm_queue.elements)
delete_queue(&alarm_queue);
@@ -244,8 +245,10 @@ sig_handler process_alarm(int sig __attribute__((unused)))
{
sigset_t old_mask;
ALARM *alarm_data;
- DBUG_ENTER("process_alarm");
- DBUG_PRINT("info",("sig: %d active alarms: %d",sig,alarm_queue.elements));
+
+/*
+ This must be first as we can't call DBUG inside an alarm for a normal thread
+*/
#if THR_SERVER_ALARM == THR_CLIENT_ALARM
if (!pthread_equal(pthread_self(),alarm_thread))
@@ -256,17 +259,20 @@ sig_handler process_alarm(int sig __attribute__((unused)))
#ifdef DONT_REMEMBER_SIGNAL
sigset(THR_CLIENT_ALARM,process_alarm); /* int. thread system calls */
#endif
- DBUG_VOID_RETURN;
+ return;
}
#endif
-
-#if defined(MAIN) && !defined(__bsdi__)
- printf("process_alarm\n"); fflush(stdout);
-#endif
+ {
#ifndef USE_ALARM_THREAD
pthread_sigmask(SIG_SETMASK,&full_signal_set,&old_mask);
pthread_mutex_lock(&LOCK_alarm);
#endif
+ DBUG_ENTER("process_alarm");
+ DBUG_PRINT("info",("sig: %d active alarms: %d",sig,alarm_queue.elements));
+
+#if defined(MAIN) && !defined(__bsdi__)
+ printf("process_alarm\n"); fflush(stdout);
+#endif
if (alarm_queue.elements)
{
if (alarm_aborted)
@@ -335,6 +341,7 @@ sig_handler process_alarm(int sig __attribute__((unused)))
pthread_sigmask(SIG_SETMASK,&old_mask,NULL);
#endif
DBUG_VOID_RETURN;
+ }
}
diff --git a/mysys/thr_mutex.c b/mysys/thr_mutex.c
index 4493c54069f..6de96f0a24a 100644
--- a/mysys/thr_mutex.c
+++ b/mysys/thr_mutex.c
@@ -53,8 +53,8 @@ int safe_mutex_lock(safe_mutex_t *mp,const char *file, uint line)
pthread_mutex_lock(&mp->global);
if (mp->count > 0 && pthread_equal(pthread_self(),mp->thread))
{
- fprintf(stderr,"safe_mutex: Trying to lock mutex at %s, line %d, when the mutex was already locked at %s, line %d\n",
- file,line,mp->file,mp->line);
+ fprintf(stderr,"safe_mutex: Trying to lock mutex at %s, line %d, when the mutex was already locked at %s, line %d in thread %s\n",
+ file,line,mp->file, mp->line, my_thread_name());
fflush(stderr);
abort();
}