diff options
author | antirez <antirez@gmail.com> | 2011-09-15 18:23:58 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2011-09-15 18:23:58 +0200 |
commit | b39a4d0b3941be82629d94dfd06f1ddc13fb260b (patch) | |
tree | 2430f3b5cd335bd9e5261905e5f215892b61d0da /src/bio.c | |
parent | fbb23ce496eaffa8313846601a73a68df0c0ba5d (diff) | |
download | redis-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.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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]); |