# HG changeset patch # User Paul Boddie # Date 1712095153 -7200 # Node ID 1625ea971bf8bfe1bf36d3aa2be942383fc6ecb0 # Parent 796f1eca3e1a94fa0ece49423027e2772c034017# Parent eff120c8f9e3bf38da7de6b28ae296f8b261af46 Merged changes from the default branch. diff -r 796f1eca3e1a -r 1625ea971bf8 libfsclient/lib/src/client.cc --- a/libfsclient/lib/src/client.cc Tue Apr 02 23:17:13 2024 +0200 +++ b/libfsclient/lib/src/client.cc Tue Apr 02 23:59:13 2024 +0200 @@ -118,9 +118,11 @@ } else { + bool initial = (file->memory == NULL); + /* Handle the initial condition with no current region. */ - if (file->memory == NULL) + if (initial) { err = client_current_region(file); if (err) @@ -150,7 +152,10 @@ else { - return client_current_region(file); + if (initial) + return L4_EOK; + else + return client_current_region(file); } } } @@ -552,7 +557,17 @@ if (!client_opened(file)) return -L4_EINVAL; - return pipe_current(file); + long err = pipe_current(file); + + if (err) + return err; + + /* Handle any case where the current region has been exhausted. */ + + if (!file_populated_span(file)) + file->data_current = 0; + + return L4_EOK; }