fixed a problem in bioOlderJobType() when there are no jobs of the specified type. Now the function returns 0 when this happens.

This commit is contained in:
antirez 2011-09-15 18:23:58 +02:00
parent fbb23ce496
commit b39a4d0b39

View File

@ -188,6 +188,10 @@ time_t bioOlderJobOfType(int type) {
pthread_mutex_lock(&bio_mutex[type]);
ln = listFirst(bio_jobs[type]);
if (ln == NULL) {
pthread_mutex_unlock(&bio_mutex[type]);
return 0;
}
job = ln->value;
time = job->time;
pthread_mutex_unlock(&bio_mutex[type]);