call watchdog_periodic in potentially long-running loops

This commit is contained in:
nvt-se 2008-07-02 15:18:43 +00:00
parent 28bcff539f
commit 65ec55e68f
1 changed files with 2 additions and 0 deletions

View File

@ -539,6 +539,7 @@ flush_log(uint16_t file_page)
offset = 0; offset = 0;
do { do {
watchdog_periodic();
n = cfs_read(fd, buf, sizeof (buf)); n = cfs_read(fd, buf, sizeof (buf));
if(n < 0) { if(n < 0) {
remove_by_page(new_file_page, 0, 0); remove_by_page(new_file_page, 0, 0);
@ -802,6 +803,7 @@ cfs_read(int fd, void *buf, unsigned size)
* ordinary file if the page has no log entry. * ordinary file if the page has no log entry.
*/ */
while(remains) { while(remains) {
watchdog_periodic();
r = -1; r = -1;
if(COFFEE_PAGE_MODIFIED(hdr)) { if(COFFEE_PAGE_MODIFIED(hdr)) {
lp.offset = base + offset; lp.offset = base + offset;