mirror of
https://github.com/ckolivas/lrzip.git
synced 2025-12-06 07:12:00 +01:00
Fix and tidy up clear_rulist.
This commit is contained in:
parent
ec54339be6
commit
ec926c62b2
15
lrzip.c
15
lrzip.c
|
|
@ -702,6 +702,21 @@ static void release_hashes(rzip_control *control)
|
||||||
dealloc(control->hash);
|
dealloc(control->hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void clear_rulist(rzip_control *control)
|
||||||
|
{
|
||||||
|
while (control->ruhead) {
|
||||||
|
struct runzip_node *node = control->ruhead;
|
||||||
|
struct stream_info *sinfo = node->sinfo;
|
||||||
|
|
||||||
|
dealloc(sinfo->ucthreads);
|
||||||
|
dealloc(node->pthreads);
|
||||||
|
dealloc(sinfo->s);
|
||||||
|
dealloc(sinfo);
|
||||||
|
control->ruhead = node->prev;
|
||||||
|
dealloc(node);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
decompress one file from the command line
|
decompress one file from the command line
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -470,7 +470,6 @@ struct rzip_control {
|
||||||
i64 (*match_len)(rzip_control *, struct rzip_state *, i64, i64, i64, i64 *);
|
i64 (*match_len)(rzip_control *, struct rzip_state *, i64, i64, i64, i64 *);
|
||||||
|
|
||||||
pthread_t *pthreads;
|
pthread_t *pthreads;
|
||||||
struct runzip_node *rulist;
|
|
||||||
struct runzip_node *ruhead;
|
struct runzip_node *ruhead;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
15
runzip.c
15
runzip.c
|
|
@ -249,21 +249,6 @@ static i64 unzip_match(rzip_control *control, void *ss, i64 len, uint32 *cksum,
|
||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
void clear_rulist(rzip_control *control)
|
|
||||||
{
|
|
||||||
while (control->ruhead) {
|
|
||||||
struct runzip_node *node = control->ruhead;
|
|
||||||
struct stream_info *sinfo = node->sinfo;
|
|
||||||
|
|
||||||
dealloc(sinfo->ucthreads);
|
|
||||||
dealloc(node->pthreads);
|
|
||||||
dealloc(sinfo->s);
|
|
||||||
dealloc(sinfo);
|
|
||||||
control->ruhead = node->prev;
|
|
||||||
dealloc(node);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* decompress a section of an open file. Call fatal_return(() on error
|
/* decompress a section of an open file. Call fatal_return(() on error
|
||||||
return the number of bytes that have been retrieved
|
return the number of bytes that have been retrieved
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
1
runzip.h
1
runzip.h
|
|
@ -22,7 +22,6 @@
|
||||||
|
|
||||||
#include "lrzip_private.h"
|
#include "lrzip_private.h"
|
||||||
|
|
||||||
void clear_rulist(rzip_control *control);
|
|
||||||
i64 runzip_fd(rzip_control *control, int fd_in, int fd_hist, i64 expected_size);
|
i64 runzip_fd(rzip_control *control, int fd_in, int fd_hist, i64 expected_size);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
5
stream.c
5
stream.c
|
|
@ -1853,8 +1853,11 @@ static void add_to_rulist(rzip_control *control, struct stream_info *sinfo)
|
||||||
failure("Failed to calloc struct node in add_rulist\n");
|
failure("Failed to calloc struct node in add_rulist\n");
|
||||||
node->sinfo = sinfo;
|
node->sinfo = sinfo;
|
||||||
node->pthreads = control->pthreads;
|
node->pthreads = control->pthreads;
|
||||||
node->prev = control->rulist;
|
|
||||||
|
lock_mutex(control, &control->control_lock);
|
||||||
|
node->prev = control->ruhead;
|
||||||
control->ruhead = node;
|
control->ruhead = node;
|
||||||
|
unlock_mutex(control, &control->control_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* close down an input stream */
|
/* close down an input stream */
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue