summaryrefslogtreecommitdiff
path: root/src/bio.c
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2011-09-15 18:23:58 +0200
committerantirez <antirez@gmail.com>2011-09-15 18:23:58 +0200
commitb39a4d0b3941be82629d94dfd06f1ddc13fb260b (patch)
tree2430f3b5cd335bd9e5261905e5f215892b61d0da /src/bio.c
parentfbb23ce496eaffa8313846601a73a68df0c0ba5d (diff)
downloadredis-b39a4d0b3941be82629d94dfd06f1ddc13fb260b.tar.gz
fixed a problem in bioOlderJobType() when there are no jobs of the specified type. Now the function returns 0 when this happens.
Diffstat (limited to 'src/bio.c')
-rw-r--r--src/bio.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/bio.c b/src/bio.c
index 6f2c8a6c0..fc4d56695 100644
--- a/src/bio.c
+++ b/src/bio.c
@@ -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]);